placeholder image to represent content

Python Recap

Quiz by Paul Cummins

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

Correct quiz answers unlock more play!

New Quizalize solo game modes
11 questions
Show answers
  • Q1
    Which of the following is a valid variable name in Python?
    variable name
    variable-name
    variable1
    1variable
    30s
  • Q2
    What symbol is used to assign a value to a variable in Python?
    :
    #
    =
    ==
    30s
  • Q3
    Which of the following statements correctly defines a string variable in Python?
    message = 'Hello, World!'
    message = "Hello, World!"
    message = 'Hello, World!"
    message = Hello, World!
    30s
  • Q4
    Which of the following statements correctly converts a user input to an integer?
    int(input('Enter a number: '))
    float(input('Enter a number: '))
    input('Enter a number: ').int()
    str(input('Enter a number: '))
    30s
  • Q5
    Which code snippet correctly prompts the user for their age and stores it as an integer?
    age = input('Enter your age: ')
    age = float(input('Enter your age: '))
    age = int(input('Enter your age: '))
    age = str(input('Enter your age: '))
    30s
  • Q6
    What will be the output of the following code: print(int('10') + 5)?
    15
    5
    Error
    10
    30s
  • Q7
    If a user inputs '5.5' and you use int() on it, what will the result be?
    6
    Error
    5.5
    5
    30s
  • Q8
    What is the correct syntax to print 'Hello, World!' in Python?
    print('Hello, World!')
    System.out.println('Hello, World!')
    print('Hello, World!')
    echo 'Hello, World!'
    30s
  • Q9
    Which of the following will correctly print a variable called 'name' in Python?
    echo name
    console.log(name)
    print(name)
    30s
  • Q10
    What will the following code output? print('Python is fun!')
    python is fun!
    Python is fun!
    Nothing will be printed
    30s
  • Q11
    How would you print a number with the message 'The answer is:' in Python?
    print('The answer is: answer')
    print('The answer is:', answer)
    print('The answer is:' + answer)
    echo 'The answer is:' answer
    30s

Teachers give this quiz to your class