placeholder image to represent content

Programming and Python

Quiz by Mrs Grimmond

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

Correct quiz answers unlock more play!

New Quizalize solo game modes
20 questions
Show answers
  • Q1
    What is the output of the following Python code: print(type([]))?
    30s
  • Q2
    Which of the following is a valid way to define a function in Python?
    function my_function():
    create my_function():
    define my_function(){}
    def my_function():
    30s
  • Q3
    What is the result of the following Python expression: 5 * 2 + 3?
    16
    8
    13
    10
    30s
  • Q4
    What does the 'len()' function do in Python?
    It converts an object to a string.
    It counts the number of unique items in a list.
    It returns the length of an object.
    It creates a new list.
    30s
  • Q5
    Which of the following correctly imports the 'math' module in Python?
    require math
    using math
    import math
    include math
    30s
  • Q6
    What is the output of the following code snippet: print(3 == 3.0)?
    True
    Error
    False
    None
    30s
  • Q7
    What keyword is used to create a loop that repeats a block of code a specific number of times in Python?
    for
    while
    repeat
    loop
    30s
  • Q8
    Which of the following methods can be used to add an element to a list in Python?
    append()
    push()
    insert()
    add()
    30s
  • Q9
    What will be the output of the following Python code: print('Hello' + 'World')?
    Hello World
    HelloWorld
    Hello+World
    Error
    30s
  • Q10
    Which of the following statements correctly creates a dictionary in Python?
    my_dict = ['key', 'value']
    my_dict = {'key': 'value'}
    my_dict = ('key', 'value')
    my_dict = key: value
    30s
  • Q11
    Which of the following is a valid way to create a list in Python?
    [1, 2, 3]
    1, 2, 3
    {1, 2, 3}
    (1, 2, 3)
    30s
  • Q12
    What is the result of the following Python expression: 5 // 2?
    3
    2.5
    1
    2
    30s
  • Q13
    What does the 'def' keyword do in Python?
    It defines a loop.
    It defines a function.
    It defines a variable.
    It defines a class.
    30s
  • Q14
    What is the purpose of the 'import' statement in Python?
    To define loops.
    To include external modules or libraries.
    To declare variables.
    To create functions.
    30s
  • Q15
    Which of the following is the correct way to create a dictionary in Python?
    (key1: value1, key2: value2)
    ['key1': 'value1', 'key2': 'value2']
    {key1, value1, key2, value2}
    {'key1': 'value1', 'key2': 'value2'}
    30s

Teachers give this quiz to your class