Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Exploring Python Fundamentals

Total questions: 9

Worksheet time: 2mins

Name
Class
Date
1.

What is the output of the following code: print(type(5))?

a)

int

b)

char

c)

float

d)

error

2.

Which of the following is not a built-in data type in Python?

a)

list

b)

tuple

c)

array

d)

dictionary

3.

What will be the output of the following code: x = 10; while x > 0: x -= 1; print(x)?

a)

10

b)

1

c)

0

d)

-1

4.

How do you create a string in Python?

a)

You can create a string in Python using single quotes, double quotes, or triple quotes.

b)

You must use a specific library to create strings.

c)

You can create a string using only numbers.

d)

Strings can only be created with special characters.

5.

What is the result of the expression 'Hello' + ' World'?

a)

HelloWorld

b)

Hello World

c)

Hello, World!

d)

Hello World!

6.

Which data type is used to store a sequence of characters?

a)

boolean

b)

integer

c)

float

d)

string

7.

What will be the output of print('Python'[::-1])?

a)

nohtyP

b)

nohtyP!

c)

Python

d)

Pyhton

8.

What is the output of len('Hello, World!')?

a)

12

b)

13

c)

14

d)

15

9.

What is the purpose of the 'break' statement in a while loop?

a)

The 'break' statement continues to the next loop without exiting.

b)

The 'break' statement skips the current iteration of the loop.

c)

The 'break' statement is used to exit a while loop.

d)

The 'break' statement pauses the while loop.