10th Grade 10 - IT Programming - 2nd Cycle Exam
Quiz
•
Computers
•
10th Grade
•
Hard
Eugene Castro
Used 9+ times
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to define a function in Python?
function myFunction()
def myFunction():
function = myFunction()
def: myFunction()
Answer explanation
The correct syntax to define a function in Python is 'def myFunction():'. This uses the 'def' keyword followed by the function name and parentheses, which is the standard way to declare functions in Python.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of a lambda function in Python?
To define a multi-line function
To create an anonymous function
To replace a list comprehension
To modify an existing function
Answer explanation
The main purpose of a lambda function in Python is to create an anonymous function, which is a function defined without a name. This allows for quick, throwaway functions that can be used in places where a full function definition is not necessary.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a mutable data type in Python?
Tuple
List
String
Set
Answer explanation
In Python, a List is a mutable data type, meaning its contents can be changed after creation. In contrast, Tuples, Strings, and Sets are immutable, meaning their contents cannot be altered once defined.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is a tuple different from a list in Python?
Tuples are mutable, lists are not
Tuples allow duplicates, lists do not
Tuples are immutable, lists are mutable
Tuples and lists are the same
Answer explanation
Tuples are immutable, meaning their contents cannot be changed after creation, while lists are mutable, allowing modifications. This key difference distinguishes how each data structure is used in Python.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will len(set([1, 2, 2, 3])) return?
2
3
4
1
Answer explanation
The set function removes duplicates from the list [1, 2, 2, 3], resulting in {1, 2, 3}. The length of this set is 3, so len(set([1, 2, 2, 3])) returns 3.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to create a tuple with a single element?
(5)
[5,]
(5,)
{5}
Answer explanation
To create a tuple with a single element, you must include a comma after the element. Thus, (5,) is correct. (5) is just an integer in parentheses, [5,] is a list, and {5} is a set.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you add an element to a set in Python?
set.append(5)
set.add(5)
set.insert(5)
set.put(5)
Answer explanation
To add an element to a set in Python, use the 'add' method. The correct syntax is 'set.add(5)', which adds the element 5 to the set. The other options are incorrect as 'append', 'insert', and 'put' are not valid methods for sets.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
38 questions
Examen Diagnóstico Páginas Web
Quiz
•
10th Grade
40 questions
KUIS SISTEM OPERASI
Quiz
•
University
40 questions
PAS TLJ KELAS 11
Quiz
•
11th Grade
40 questions
Kuiz Komputer Online
Quiz
•
6th - 10th Grade
35 questions
Algoritma dan Logika Informatika
Quiz
•
University
35 questions
Bab 3-Sistem Komputer -Grade 5
Quiz
•
5th Grade - University
40 questions
Python Quiz
Quiz
•
University
40 questions
Sistem Komputer
Quiz
•
10th Grade
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
20 questions
Halloween movies trivia
Quiz
•
7th - 12th Grade
15 questions
Halloween Characters
Quiz
•
7th - 12th Grade
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
10 questions
Halloween Trivia Challenge
Interactive video
•
6th - 10th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
14 questions
Halloween Fun
Quiz
•
2nd - 12th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
