NEW
Font size
WorksheetsGrade10-11 Quiz(variables, if-else, while loops)
Total questions: 37
Worksheet time: 29mins
What language is used in Riders?
Python
Java
Java Script
C++
Look at the following code:
name = "John"
age = 23
What type of data is stored in the variable name?
str
int
float
nothing
Look at the following code:
name = "John"
age = 23
What type of data is stored in the variable age?
str
int
float
nothing
Look at the following code:
name = "John"
age = "23"
What type of data is stored in the variable age?
str
int
float
nothing
If I want to store my height in a variable, which of the following would be a good variable name in best practice?
abcdefg
inches
number
height
If I want to store my name in a variable, which of the following would be a good variable name in best practice?
name
teacher
mister
abcdef
If I want to store multiple names in variables, which of the following would be good variable names in best practice?
a
b
c
name1
name2
name3
Audrey
Ben
John
blah1
blah2
blah3
---------------------- is a reference to a location in memory where the data is stored.
Variable
python
Vakue
Operators
After run the following code, x = -------------
12
15
36
1728
After run the following code , the output will be -----------------
test
exam
testexam
z
After run the following code , the output will be -----------------
test
exam
testexam
z
After run the following code, x = -------------
12
2
14
24
Which is the python logo?
Top left
Bottom left
Top right
Bottom right
What will be the output after the following statements?
15
yes
equal
no
error
Which symbol means "not equal to"?
==
<=
>=
!=
print(Hello world!)
Which character must be at the end of the line for if?
:
;
.
{
What will be the output after the following statements?
0
1
2
15
error
One of the lines contains at least one error.
Which line is it?
What will this program output?
:(
":("
Error
nothing
What will be displayed at the end of the program?
Case 1
Case 2
Nothing will be displayed.
Case 1 and Case 2
What will be displayed at the end of the program?
Case 1
Case 2
Nothing will be displayed.
Case 1 and Case 2
What will display at the end of the program running?
You can ride the carousel!
Nothing will display
You cannot ride the carousel!
There will be an error.
What will display at the end of the program running?
You can ride the carousel!
Nothing will display
Sorry! Not tall enough!
There will be an error.
What will display at the end of the program running?
You can ride the carousel!
Nothing will display
Sorry! Not tall enough!
There will be an error.
5
4
3
2
1
4
3
2
1
0
0
Infinite loop
0
4
3
2
1
0
5
4 3 2 1 0
5
4
3
2
1
4
3
2
1
0
0
Infinite loop
Which of the following is the definition of Iteration in terms of programming
Repetition of a sequence, usually with some change
A gap at the start of a line of code
A line of code that includes a condition, followed by lines of code that only run if the condition is met
Repetition of the first letter at the start of each word in a sentence
Which of the following is the definition of Indentation in terms of programming
Repetition of a sequence, usually with some change
A gap at the start of a line of code
A line of code that includes a condition, followed by lines of code that only run if the condition is met
Repetition of the first letter at the start of each word in a sentence
What will happen when this program runs
It will display numbers 0-10 on separate lines
It will display numbers 0-9 on separate lines
It will crash
It will display 0s in an infinite loop
What will happen when this program runs
It will display numbers 0-10 on separate lines
It will display numbers 0-9 on separate lines
It will crash
It will display 0s in an infinite loop
What will happen when this program runs
It will display numbers 0-10 on separate lines
It will display numbers 0-9 on separate lines
It will crash
It will display 0s in an infinite loop
What will happen when this program runs
It will display numbers 0-10 on separate lines
It will display numbers 0-9 on separate lines
It will crash
It will display 0s in an infinite loop
Which of the following keywords is used to create a while loop in Python?
repeat
while
loop
until
Which of the following statements will correctly increment a variable `count` by 1 inside a while loop?
count = count + 1
count += 1
Both A and B
count =+ 1
Which of the following is the correct way to use break in a while loop?
break()
break
stop
exit()
