-
What data type does the print() function return in Python? a. Integer * b. Float c. String d. Boolean
-
Which of the following lines of code will create a tuple in Python? a. my_tuple = (1,2,3) * b. my_tuple = (1;2;3) c. my_tuple = ‘1,2,3’ d. my_tuple = {1,2,3}
-
In Python, which of the following symbols is the modulo operator? a. ! b. % * c. && d. ||
-
What type of loop will execute a statement or group of statements while a given condition is TRUE? a. while loop * b. do-while loop c. for loop d. if-else loop
-
What is mutable in Python? a. String b. Integer c. Float d. List *
-
In Python, what does the ‘break’ statement do? a. Print the statement b. Stop the current iteration of a loop * c. Skip the current iteration of a loop d. Ignore the current loop and continue
-
What parameter does the range() function take in? a. Value b. Size c. Start, stop, step *
d. Minimum, maximum -
How do you check the type of an object in Python? a. type() * b. pointer() c. check() d. id()
-
What will be the output of the following code snippet?
list1 = [1, 2, 3, 4] list2 = [3, 4, 5, 6]
list3 = list1 + list2
print(list3)
a. 1, 2, 3, 4, 5, 6 * b. [1, 2, 3, 4, 5, 6] c. [1, 2, 3, 4], [3, 4, 5, 6] d. [3, 4, 5, 6, 1, 2]
- Which of the following is not a list method in Python? a. copy() b. reverse() * c. append() d. extend()
Loading...