NEW
Font size
WorksheetsEnd of term assessment
Total questions: 15
Worksheet time: 1hrs 3mins
The best structure for implementing a multi-way decision in Python is:
if
if-else
if- elif- else
comparison operator
Which one of the following is a valid Python if statement
if x >= 5:
if (x >= 5)
if (x => 55)
if x >= 5
Find the value returned by the logical operator in the following case
5 > 6 and 8 < 15
True
False
Find the value returned by the logical operator in the following case
5>6 or 8<15
True
False
Find the value returned by the logical operator in the following case
not 5>6
True
False
Find the value returned by the logical operator in the following case
13<20 and 25>20
True
False
Find the value returned by the logical operator in the following case
a=b=c=5 a+b>c and a+c>b or b+c>a
True
False
What is the output of the given below program?
if 6 + 4 == 10:
print("Right")
else:
print("Wrong")
print("Next condition")
Right
Wrong
Right
Next condition
Wrong
Next condition
2. What will be printed on the console after executing the program given below?
a = 59
if(a > 55):
print("Yes")
if(a < 55):
print("No")
Yes
No
What is the output of the given below program?
if 6 + 4 != 10:
print("Right")
else:
print("Wrong")
print("Next condition")
Right
Wrong
Right
Next condition
Wrong
Next condition
What is the output of print("Better".replace("e","u"))?
Beuuer
Butter
Buttur
None of the above
What is the output of print(len("python"))
6
7
5
Syntax Error
What is the output of print("I love UAE".count("e"))
2
1
Syntax Error
Non of the above
What is the output of s1="I Like coding"
print (s1[5])
k
c
e
d
What is the output of s1="I Like coding"
print (s1[-5])
e
c
o
d
