NEW
Font size
WorksheetsQuiz 1 - Python
Total questions: 15
Worksheet time: 8mins
In programming, what is a variable?
How many variables exist in the following code?
Two - Num1 and Num2
Three - if, elif and else
Two - AND, OR
What would be output if the following code was executed?
Num1 is larger
Num1 is smaller
Both the same
In python programming, what does the following code demonstrate?
Selection
Iteration
Variable Assignment
Which of the following is a valid variable name in Python?
1variable
variable_name
variable-name
Which of the following would produce an error?
print(7 * 7)
print(7 * "7")
print("7" * "7")
Which is the correct definition for "syntax"
The rules of language
The errors that a program produces
The programming concepts such as variables and selection
Which of the following data types is the value stored in myVariable?
Integer
Float
String
Which of the following data types is the value stored in myVariable?
Integer
Float
String
What is the result of the following expression in Python: 5 + 3 * 2?
16
11
13
What is the output of the following Python code: print(2 ** 3)?
6
8
9
What would the best explanation of the following code be?
To tell somebody how long is left until they can vote
To tell somebody whether they are old enough to vote, or not.
To tell somebody how old they are.
What is the correct way to use "input" in python?
Select the true statement:
input() is always input as an integer
input() is always input as a string
input() is always input as a float
What would the following code do: int(input())
Take in some user input and store it as a string
Nothing, it would return an error
Take in some user input and store it as an integer
