
Variables, Errors and Input
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
10 questions
Show answers
- Q1What is the output of the following code: a = int(input('Enter a number: ')); print(a * 2) if a = 5?151025530s
- Q2What will the output be when the following code is run: value = int(input('Enter a number: ')); print(value + 10) if value == 10?2030None1030s
- Q3What will the following code output if the user inputs '7': a = int(input('Enter a number: ')); print(a + 5)?71251030s
- Q4What will be the output of the following code if the input is '3': x = int(input('Enter a number: ')); print(x * x)?9631230s
- Q5What is a valid variable name in Python?my_variable1my-variable1st_variablemy variable30s
- Q6What is the primary rule for naming variables in most programming languages?Variable names can include special characters like @ and #Variable names must be longer than 10 charactersVariable names can start with a numberVariable names should not contain spaces30s
- Q7What is a runtime error?An error that is identified during the writing of the codeAn error that prevents the program from compilingAn error due to incorrect spelling in the codeAn error that occurs while the program is running30s
- Q8What is a syntax error?An error in the code that occurs when the rules of the programming language are not followedAn error that occurs during the execution of the programA logical error that produces incorrect resultsAn error related to the hardware of the computer30s
- Q9Which of the following is an example of a syntax error?Forgetting a closing bracket in a functionUsing an undefined variable in the calculationTrying to access an element from an empty listDividing a number by zero30s
- Q10What happens when a syntax error is present in the code?The error is ignored and the program completes executionThe program runs but produces incorrect outputThe program will not run until the error is fixedThe program runs but crashes at some point30s