placeholder image to represent content

About Python variables and list

Quiz by Mohammed Abdul Matheen

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
9 questions
Show answers
  • Q1
    Which of the following is a valid variable name in Python?
    My_variable
    my Variable
    myVariable
    5myVariable
    30s
  • Q2
    What will be the output of the following code?numbers = [1, 2, 3]print(numbers[2])
    1
    2
    3
    0
    30s
  • Q3
    How do you add an element to the end of a list in Python?
    append()
    remove()
    insert()
    extend()
    30s
  • Q4
    How do you access the second element in a list called 'myList'?
    myList[3]
    myList[0]
    myList[1]
    myList[2]
    30s
  • Q5
    Which of the following is NOT a valid data type in Python?
    string
    number
    boolean
    list
    30s
  • Q6
    What is the correct way to declare a list in Python?
    myList = ()
    myList = []
    myList = ''
    myList = {}
    30s
  • Q7
    Which of the following is a valid way to remove an element from a list in Python?
    pop()
    clear()
    remove()
    delete()
    30s
  • Q8
    What is the output of the following code?myList = ['apple', 'banana', 'orange']print(len(myList))
    0
    1
    2
    3
    30s
  • Q9
    What is the correct syntax to access the last element in a list called 'myList' in Python?
    myList[0]
    myList[-1]
    myList[-2]
    myList[1]
    30s

Teachers give this quiz to your class