wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Lesson 2-keywords and operators-1

Total questions: 20

Worksheet time: 40mins

Name
Class
Date
1.

Which one is not a keyword ?

a)

as

b)

for

c)

in

d)

ask

2.

What are keywords ?

a)

predefined words

b)

key to open python

c)

simple words

d)

none

3.

what does ord() return ?

a)

unicode

b)

ascii code

c)

python code

d)

ford keyword

4.

what did str() do ?

a)

convert into string datatype

b)

convert into list datatype

c)

convert into set datatype

d)

convert into tuple datatype

5.

what is the output of the following code ?

a = “5”

b = 2

c = a+b

print(c)

a)

52

b)

7

c)

10

d)

Type Error

6.

What do you mean by memory address ?

a)

Address of program

b)

Address of memory location

c)

Address of songs

d)

none

7.

what is the output of the following statement ?

print(“apple”+” mango”)

a)

apple

b)

mango

c)

applemango

d)

none

8.

Which of the following are not the strings in python ?

1) “ “ 2) “akansha” 3) “””rohima””” 4) sakshi 5) ‘sarvan” 6) ‘6’

a)

2 and 3

b)

1 and 3

c)

3 and 4

d)

4 and 5

9.

How many keywords are there in python ?

a)

32

b)

33

c)

34

d)

35

10.

what will happen if we convert the type of a float data into integer ?

a)

fraction part removed

b)

integer part removed

c)

no change

d)

Type Error

11.

Which arithmetic operator has highest precedence ?

a)

**

b)

+

c)

-

d)

/

12.

What is the output of the following code ?

print(int(True))

a)

0

b)

True

c)

False

d)

1

13.

What is the output of The following code ?

a = “5”

b = 5

print(a==b)

a)

1

b)

0

c)

True

d)

False

14.

what is the output of the following code ?

a = “5”

b = 2

c = a*b

print(c)

a)

45

b)

55

c)

65

d)

10

15.

What is the output of the following code ?

print( 9>8>5>3>1 )

a)

1

b)

0

c)

True

d)

False

16.

What is the output of following code ?

print(99%3)

a)

33

b)

0

c)

3

d)

99

17.

what is the output of the following statement ?

print(“apple”+” mango”)

a)

apple

b)

mango

c)

applemango

d)

none

18.

what is the output of the following statement ?

print(“apple”*” mango”)

a)

apple

b)

mango

c)

applemango

d)

Type Error

19.

What is the output of the following code ?

a = 5

a +=2

print(a)

a)

10

b)

7

c)

5

d)

3

20.

The operator used to compare two numbers is

a)

=

b)

==

c)

*

d)

none