
Python basic print, input keyword commands and variable names
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
12 questions
Show answers
- Q1What will the following Python code output: print('Hello, World!')?Hello, WorldHello, World!Hello World!Hello World30s
- Q2Which of the following variable names is valid in Python?@variable2ndVariablemy-variablemy_variable30s
- Q3What will be the output of the following code: name = 'Alice'; print(name)?ErrorAliceName'Alice'30s
- Q4Which of the following will correctly print the value of the variable 'age' which is set to 15?print(15)print(age)print('age')print(age + 0)30s
- Q5What will the following code print? x = 10; print('The value is', x)The value is x10The value is 10The value is30s
- Q6Which of the following is an example of a valid print statement in Python?print[Hello, World!]echo 'Hello, World!'println('Hello, World!')print('Hello, World!')30s
- Q7What will the following code produce? name = 'Bob'; print('Hello, ' + name)Hello, Bob!Hello, BobHello, nameHello, Bob;30s
- Q8What is the output of this Python code snippet? score = 95; print('Your score is:', score)Your score is: scoreYour score is: 95.score = 95Your score is: 9530s
- Q9Which of the following variable names is NOT valid in Python?variable1my_variable_variable1st_variable30s
- Q10What will the following code output? animal = 'dog'; print('I have a', animal)I have a dog!I have aI have a animalI have a dog30s
- Q11What function is used in Python to read a line of input from the user?getInput()read()input()scan()30s
- Q12Which of the following statements correctly prompts the user for their name?name = read('Enter your name: ')name = input('Your name?')name = input('Enter your name: ')name = getInput('Enter your name: ')30s