NEW
Font size
WorksheetsPython Quiz
Total questions: 10
Worksheet time: 6mins
Which one of the following is not a valid variable name.
a2
a2a
22a
_abc
Guess the output:
a = 255
b = 255
print(a == b)
True
False
Guess the output:
a = 257
b = 257
print(a is b)
True
False
Guess the output:
p, q, r = 10, 20 ,30
print(p, q, r)
10 20 30
10, 20, 30
Invalid Syntax
Guess the output:
name = "Rahul"
print(name[::])
"Rahul"
Syntax error
" "
Guess the output:
name = "Rahul"
print(name[2::-1])
"Rah"
"ha"
"luh"
"haR"
Guess the output:
a = 0
b = 1
c = "2"
print(a + b + c)
3
"012"
2
TypeError
Guess the output:
value = "Rahul" * 2
print(value)
SyntaxError
"RahulRahul"
"Rahul"
Guess the output:
for i in range(1, 7, 2):
print(i, end=",")
1 2 3 4 5 6 7,
1,3,5,
1,3,5
1,2,3,4,5,6,
Guess the output:
li = [2, 3, 5]
li.append("Rahul")
print(li)
SyntaxError
[2, 3, 5, 'Rahul']
['Rahul', 2, 3, 5]
