
Python Recap
Quiz by Paul Cummins
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
11 questions
Show answers
- Q1Which of the following is a valid variable name in Python?variable namevariable-namevariable11variable30s
- Q2What symbol is used to assign a value to a variable in Python?:#===30s
- Q3Which of the following statements correctly defines a string variable in Python?message = 'Hello, World!'message = "Hello, World!"message = 'Hello, World!"message = Hello, World!30s
- Q4Which 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
- Q5Which 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
- Q6What will be the output of the following code: print(int('10') + 5)?155Error1030s
- Q7If a user inputs '5.5' and you use int() on it, what will the result be?6Error5.5530s
- Q8What 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
- Q9Which of the following will correctly print a variable called 'name' in Python?echo nameconsole.log(name)print(name)30s
- Q10What will the following code output? print('Python is fun!')python is fun!Python is fun!Nothing will be printed30s
- Q11How 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:' answer30s