WorksheetsPython Ranges and Operators
Total questions: 17
Worksheet time: 9mins
What is the output of the following code
Salary: 12000 Salary: 8000
Salary: 8000 Salary: 12000
The program failed with errors
What is the output of the following code?
The program executed with errors
[‘Jon’, ‘Kelly’, ‘Scott’, ‘Jessa’]
[‘Jon’, ‘Kelly’, ‘Jessa’, ‘Scott’]
[‘Jon’, ‘Scott’, ‘Kelly’, ‘Jessa’]
What is the output of the following code?
True
True
True
False
False
True
False
False
What is the output of the following code?
20
30
The program executed with errors
24
What is the output of the following code?
{‘Vicki’, ‘Jodi’, ‘Garry’, ‘Eric’}
{‘Jodi’, ‘Vicki’, ‘Garry’, ‘Eric’}
The program executed with error
What is the output of the following code?
py
yn
pyn
yna
Can we use the “else” block for for loop?
for example:
No
Yes
What is the output of the following code?
10
15
25
125
Error: invalid syntax
Which operator has higher precedence in the following list
% (Modulus)
& (BitWise AND)
** (Exponent)
> (Comparison)
What is the output of the following code?
name = "James"
print(name * 6)
JamesJamesJamesJamesJamesJames
JamesJamesJamesJamesJames
Error: invalid syntax
JaJaJamesJamesJamesmesmes
What is the output of the following code?
Jam
dno
maJ
dnoB semaJ
What is the output of the following code?
[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5]
[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]
The Program executed with errors
What is the output of the following code?
10 20
10 20 30
Error: invalid syntax
What is the output of the following code?
10, 11, 12, 13, 14,
10, 11, 12, 13, 14, 15,
What is the output of the following code?
6
33
123
Error. Mixing operators between numbers and strings are not supported
What is the output of the following
182.0
37
117
The program executes with errors
The in operator is used to check if a value exists within an iterable object container such as a list. Evaluate to True if it finds a variable in the specified sequence and False otherwise.
True
False
