No student devices needed. Know more
20 questions
Lines 1-3 show a partial program which creates a list of days of the week and assigns it to days.
If lines 4 & 5 were added to the program, what would the program output be?
item
Wednesday
Thursday
3
Which operator is used to multiply numbers?
*
x
#
%
Lines 1-3 show a partial program which creates a list of days of the week and assigns it to days.
If lines 4-6 were added to the program, what would the program output be?
Tuesday
1 Monday
1 Wednesday
Wednesday
Which operator can be used to compare two values?
=
==
<>
><
What word would fill the gap in this code so that the items in the list days are displayed on the screen.
week
index
days
day
How do you start writing a for loop in Python?
for each x in y:
for x > y:
for x in y:
If the user types 1 on the keyboard, what will be the output of this program when it is executed?
The second letter is e
It's a rocky planet
a e
The second letter is a
How do you start writing a while loop in Python?
while x > y {
x > y while {
while (x > y)
while x > y:
If the user types 3 on the keyboard, what will be the output of this program when it is executed?
The second letter is e
It's a rocky planet
a e
The second letter is a
In Python, 'Hello', is the same as "Hello"
True
False
The ‘rocky planets’ are the first four planets of the solar system. How would you modify the program so that all planets are correctly classified (i.e. the message “It’s a rocky planet” is displayed for all four of them).
Change the condition in line 6 to
index > 5 or index >= 4.
Change the condition in line 6 to
index < 5 or index <= 4.
Change the condition in line 6 to
index < 4 or index <= 3.
How do you start writing an if statement in Python?
if x > y then:
if x > y:
if (x > y)
What will be the output of this program?
2
3
d
'c' + 1
Which of these collections defines a LIST?
{"apple", "banana", "cherry"}
("apple", "banana", "cherry")
["apple", "banana", "cherry"]
{"name": "apple", "color": "green"}
This program converts a binary number to its decimal equivalent. Which are the variables in the program?
binary, decimal, weight, reversed, digit
binary, decimal, weight
binary, decimal, weight, digit
This program converts a binary number to its decimal equivalent. Locate the line of code where program execution is suspended until the user enters a value on the keyboard.
1
4
5
8
This program converts a binary number to its decimal equivalent. Locate the line of code that doubles the value of a variable.
5
6
7
8
This program converts a binary number to its decimal equivalent. Locate the line of code that contains a condition (a logical expression)
1
4
5
8
Which operation will add an item to the end of a Python list
list.append(item)
list.add(item)
list.plus(item)
list.addition(item)
What symbol is used in python to assign values to a variable?
plus +
forward slash /
equals =
asterisk *
Explore all questions with a free account