wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python

Total questions: 10

Worksheet time: 8mins

Name
Class
Date
1.

Find T ?

T=144 / 2 + 5 * 9 - ( 8 -3 )

a)

106

b)

688

c)

112

d)

684

2.

Find the Output:

Item = {"ECE" , "CSE" , "EEE" , "CIVIL"}

Item.add (2,"MECH")

print(Item)

a)

{ "ECE" , "MECH" , "CSE" , "EEE" , "CIVIL" }

b)

{ "ECE" , "CSE" , "MECH" , "EEE" , "CIVIL" }

c)

{ "ECE" , "CSE" , "EEE" , "CIVIL" }

d)

{ "ECE" , "CSE" , "EEE" ,"MECH" , "CIVIL" }

3.

Find the Output ?

A = "Anand Institute of higher technology"

print ( A[-5:7]

a)

_Institute of higher techn

b)

nstitute of higher technol

c)

d Institute of higher techn

d)

Institute of higher techno

4.

def.number (r1 , r2)

sum = r1 / r2

return sum

a = number (r2 = 15 , r1 = 10)

a)

2 / 3

b)

3 / 2

c)

error

d)

2

5.

what is the output of the following code ?

var1 = 1

var2 = 2

var3 = "3"


print (var + var2 var3)

a)

Error. Mixing operators between numbers and strings are not supported

b)

6

c)

33

d)

123

6.

Which of the following function convert a string to a float in python ?

a)

float(X)

b)

int(x[,base])

c)

long(X[,base])

d)

str(X)

7.

what is the output of the following programing ?

X = [ 'ab' , 'cd' ]

for i in X:

i.upper()

print (x)

a)

[ 'AB' , 'CD' ]

b)

[ 'ab' , 'cd' ]

c)

[ AB , CD ]

d)

ERROR

8.

find p ?

p = ( 35 , 46 , 73 , 21 )

p.append( -2 , 24 )

print (p)

a)

( 35 , 46 , 73 , 24 , 21 )

b)

error

c)

( 35 , 46 , 24 , 73 , 21 )

d)

( 35 , 24 , 73 , 21 )

9.

what will be the output of the following python code snippet ?

not (10 < 20) and not (10 > 30 )

a)

TRUE

b)

FALSE

10.

Find the output ?

a = True

b = False

c = False

if a or b and c :

print "INFYTQ"

else:

print "infytq"

a)

infytq

b)

INFYTQ

c)

ERROR