wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PP Quiz- 4CSM B2

Total questions: 11

Worksheet time: 11mins

Name
Class
Date
1.

Enter your ROLL NO.

4 lines
2.

print(3+3==6 or 1+5==6)

what is the output?

a)

true

b)

false

c)

both

d)

none of the above

3.

What is the output of the following?print(not(2+2==6) and 2+3==5)

a)

none of them

b)

true and true

c)

False

d)

True

4.

How can we increment a integer (e.g num = 5) variable by 1?

a)

num=+1

b)

num+=1

c)

num++

d)

More than one choice is correct.

5.

Which of the following is TRUE?

a)

The equal to operator (=) is used for comparison.

b)

None of these.

c)

The equal to operator (==) is used for assignment.

d)

The equal to operator (==) is used for assignment.

6.

Which of the following is the correct syntax to check if the variable x is equal to 5?

a)

if (x=5)

b)

if (x==5)

c)

if (x=5):

d)

if (x==5):

7.

What is the output of the following?

print (1/2 + 1.0/2)

a)

2.5

b)

0.5

c)

1.5

d)

None of these

8.

Which of the following is FALSE about variables?

a)

Variables must begin with a letter.

b)

Variables can be one of the reserved Python keywords like def, elif etc.

c)

Variables can contain letters, numbers, and underscores.

d)

All of these are TRUE.

9.

What is the output of the following?

x=5

if (x==5):  

print("x==5")

else:    

print ("x=5")

a)

x=5 x==5

b)

x=5

c)

x==5

d)

The code has syntax errors.

Next

10.

How can we  convert the following variable to a string?

num = 5

a)

str(num)

b)

num + ""

c)

All of these.

d)

string(num)

Next

11.

What is the output of the following code?

print (str(bool(1) + float(10)/float(2)))

a)

"2.5"

b)

1.5

c)

6.0

d)

"6.0"

Next