wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

End of term assessment

Total questions: 15

Worksheet time: 1hrs 3mins

Name
Class
Date
1.

The best structure for implementing a multi-way decision in Python is:

a)

if

b)

if-else

c)

if- elif- else

d)

comparison operator

2.

Which one of the following is a valid Python if statement

a)

if x >= 5:

b)

if (x >= 5)

c)

if (x => 55)

d)

if x >= 5

3.

Find the value returned by the logical operator in the following case

5 > 6 and 8 < 15

a)

True

b)

False

4.

Find the value returned by the logical operator in the following case

5>6 or 8<15

a)

True

b)

False

5.

Find the value returned by the logical operator in the following case

not 5>6

a)

True

b)

False

6.

Find the value returned by the logical operator in the following case

13<20 and 25>20

a)

True

b)

False

7.

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

a)

True

b)

False

8.

What is the output of the given below program?

if 6 + 4 == 10:

print("Right")

else:

print("Wrong")

print("Next condition")

a)

Right

b)

Wrong

c)

Right

Next condition

d)

Wrong

Next condition

9.

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")

a)

Yes

b)

No

10.

What is the output of the given below program?

if 6 + 4 != 10:

print("Right")

else:

print("Wrong")

print("Next condition")

a)

Right

b)

Wrong

c)

Right

Next condition

d)

Wrong

Next condition

11.

What is the output of print("Better".replace("e","u"))?

a)

Beuuer

b)

Butter

c)

Buttur

d)

None of the above

12.

What is the output of print(len("python"))

a)

6

b)

7

c)

5

d)

Syntax Error

13.

What is the output of print("I love UAE".count("e"))

a)

2

b)

1

c)

Syntax Error

d)

Non of the above

14.

What is the output of s1="I Like coding"

print (s1[5])

a)

k

b)

c

c)

e

d)

d

15.

What is the output of s1="I Like coding"

print (s1[-5])

a)

e

b)

c

c)

o

d)

d