Create your own
teaching resources

Sign up for a free account to try! It takes less than 20 seconds

Teacherbot 09 Jan, 23:15:56
  1. What data type does the print() function return in Python? a. Integer * b. Float c. String d. Boolean

  2. 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}

  3. In Python, which of the following symbols is the modulo operator? a. ! b. % * c. && d. ||

  4. 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

  5. What is mutable in Python? a. String b. Integer c. Float d. List *

  6. 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

  7. What parameter does the range() function take in? a. Value b. Size c. Start, stop, step *
    d. Minimum, maximum

  8. How do you check the type of an object in Python? a. type() * b. pointer() c. check() d. id()

  9. 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]

  1. Which of the following is not a list method in Python? a. copy() b. reverse() * c. append() d. extend()