wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Quiz – Data Types and If Statements

Total questions: 14

Worksheet time: 7mins

Name
Class
Date
1.

I am 42. Who am I?

a)

int

b)

float

c)

str

d)

complex

2.

I am 'Hello'. Who am I?

a)

int

b)

float

c)

str

d)

complex

3.

I am 3.14. Who am I?

a)

int

b)

float

c)

str

d)

complex

4.

I am 5 + 2j. Who am I?

a)

int

b)

float

c)

str

d)

complex

5.

Rezultati i int('123') në Python është:

a)

float

b)

int

c)

str

d)

complex

6.

numri = 5 if numri > 3: print('Po') Çka printohet?

a)

Po

b)

Jo

c)

Nuk printon asgjë

d)

Gabim

7.

n = -2 if n > 0: print('Pozitiv') Çka ndodh?

a)

Printon 'Pozitiv'

b)

Nuk printon asgjë

c)

Gabim

d)

Printon -2

8.

Cili if kontrollon nëse tekst == 'hello'?

a)

if tekst = 'hello':

b)

if tekst == 'hello':

c)

if tekst === 'hello':

d)

if tekst != 'hello':

9.

x = 150 if x > 100: print('Numër i madh') Çka printohet?

a)

Printon 'Numër i madh'

b)

Printon 'Vogël'

c)

Nuk printon asgjë

d)

Gabim

10.

y = 30 if y < 50: print('Vogël') Çka printohet?

a)

Printon 'Vogël'

b)

Printon 'I madh'

c)

Nuk printon asgjë

d)

Gabim

11.

numri = 10 if numri == 10: print('Po') Is the above code correct?

a)

True

b)

False

12.

n = -5 if n > 0: print('Pozitiv') Is the above code correct?

a)

True

b)

False

13.

x = 100 if x != 100: print('Jo') Is the above code correct?

a)

True

b)

False

14.

tekst = 'hello' if tekst == 'Hello': print('Përputhet') Is the above code correct?

a)

True

b)

False