Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Intro & Types Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What is Python mainly used for?

a)

Web development

b)

Data analysis

c)

Making games

d)

All of the above

2.

What symbol is used to start a comment in Python?

a)

//

b)

#

c)

/*

d)

3.

What is a variable in Python?

a)

A type of loop

b)

A container for values

c)

A function

d)

A module

4.

What type of value is 4.5?

a)

Integer

b)

Float

c)

String

d)

Boolean

5.

Which of these is a correct variable name?

a)

my var

b)

1st_name

c)

userName

d)

@value

6.

What does the print() function do?

a)

Add two numbers

b)

Display output

c)

Create variables

d)

Stop the program

7.

Which value is a string?

a)

'Hello'

b)

7

c)

4.2

d)

True

8.

Which operator is used for exponentiation?

a)

*

b)

^

c)

**

d)

%

9.

What does 'int' represent?

a)

A decimal number

b)

A whole number

c)

A text value

d)

A boolean value

10.

What will '5' + '2' return?

a)

7

b)

52

c)

Error

d)

10

11.

What type is the value True?

a)

String

b)

Integer

c)

Float

d)

Boolean

12.

What is the keyword to define a variable?

a)

var

b)

define

c)

let

d)

None of these

13.

Which function gives the length of a string?

a)

size()

b)

length()

c)

len()

d)

count()

14.

What does 10 // 3 return?

a)

3

b)

3.3

c)

3.33

d)

1

15.

What does 10 % 3 return?

a)

0

b)

1

c)

2

d)

3

16.

What type is 'True'?

a)

Boolean

b)

Integer

c)

String

d)

Float

17.

What is the output of print(3 * 'Hi')?

a)

3Hi

b)

HiHiHi

c)

Error

d)

Hi*3

18.

What type is the result of 7 / 2?

a)

Integer

b)

Float

c)

String

d)

Boolean

19.

Which of the following is NOT a data type in Python?

a)

int

b)

str

c)

num

d)

bool

20.

What value does bool(0) return?

a)

True

b)

False

c)

0

d)

Error

21.

Which one of these is not used for math operations?

a)

+

b)

-

c)

@

d)

*

22.

What is the result of 3 + 4 * 2?

a)

14

b)

11

c)

10

d)

9

23.

What is the type of '123'?

a)

int

b)

str

c)

float

d)

bool

24.

Which keyword is used to check data type?

a)

typeof

b)

type()

c)

datacheck

d)

checktype

25.

What is the result of int('4')?

a)

'4'

b)

4

c)

Error

d)

4.0

26.

What is 3.0 * 2?

a)

5

b)

6

c)

6.0

d)

3

27.

Which of these is a Boolean operator?

a)

and

b)

plus

c)

times

d)

divide

28.

What does 5 > 2 return?

a)

True

b)

False

c)

3

d)

Error

29.

What is the output of print(type(3.5))?

a)

int

b)

float

c)

str

d)

bool

30.

What does input() do?

a)

Prints text

b)

Takes user input

c)

Exits the program

d)

Finds length

31.

What is the output of len('Hi')?

a)

1

b)

2

c)

3

d)

Error

32.

What is the output of type(True)?

a)

bool

b)

Boolean

c)

Bool

d)

boolean

33.

What is the result of 4 + int('3')?

a)

7

b)

43

c)

Error

d)

4

34.

Which is NOT a built-in data type?

a)

int

b)

str

c)

long

d)

float

35.

What does 3 * 2 + 1 equal?

a)

7

b)

9

c)

8

d)

6

36.

What will print('Hello' + 'World') show?

a)

HelloWorld

b)

Hello World

c)

Hello+World

d)

Error

37.

What does bool('') return?

a)

True

b)

False

c)

Error

d)

None

38.

Which function converts to string?

a)

str()

b)

to_string()

c)

string()

d)

convert()

39.

What is the result of 'a' * 4?

a)

aaaa

b)

Error

c)

4a

d)

a a a a

40.

What will print(7 % 2) display?

a)

3

b)

2

c)

1

d)

0