wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python - Data types and Conditional statements

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

which function is used to find the ASCII value of a character ?

a)

range ()

b)

ord()

c)

chr()

d)

add()

2.

True and False is a which type of data types ?

a)

string

b)

char

c)

bool

d)

float

3.

Python was released in which year ?

a)

1991

b)

1992

c)

1994

d)

1995

4.

What will be the output of the given code :

a = int(6.58)

if(a>6):

print("Hi")

else:

print("Bye")

a)

Hi

b)

Bye

c)

Error

d)

Both Hi and Bye

5.

What will be the output of the given code:

A = 10

B = 20

PRINT(A+B)

a)

1020

b)

30

c)

A+B

d)

error

6.

What will be the output of the given code:

A = 10

B = 20.45

print(int(A+B))

a)

30.45

b)

error

c)

30

d)

1020.45

7.

What will be the output of the given code:

print("Hello\nWelcometo\nPython")

a)

HelloWelcometoPython

b)

Hello Welcome to Python

c)

Hello

Welcometo

Python

d)

error

8.

while is a :

a)

conditional statement

b)

function

c)

loop

d)

escape sequences

9.

What will be the output of the given code ?

A = 20

B = 15

C = 10

if(B > C and A > B):

print("Good Work!")

else :

print("Try Again!")

a)

Good Work!

b)

Try Again!

c)

Error

d)

Will not print anything

10.

What will be the output of the given code:

A = 20

B = 15

C = 20

if(A==C):

print("A and C Both are equal")

else :

print("Not Equal")

a)

Error

b)

Not Equal!

c)

A and C Both are equal

d)

Will not print anything