wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

L1 Console, Variables and Creating a Program

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the command used to display text in the Python console?

a)

print

b)

display

c)

show

d)

write

2.

What is the purpose of variables in programming?

a)

To store temporary data

b)

To perform arithmetic operations

c)

To display text in the console

d)

To create programs

3.

Which data type is used to store whole numbers in Python?

a)

String

b)

Integer

c)

Float

d)

List

4.

What is the result of the expression '10 + 20'?

a)

30

b)

1020

c)

Error

d)

None of the above

5.

Which function is used to convert a number to a string in Python?

a)

int

b)

str

c)

float

d)

list

6.

What is the correct way to add a string and a number in Python?

a)

string + number

b)

number + string

c)

str(number)

d)

int(string)

7.

What is the purpose of the 'print' function in Python?

a)

To perform arithmetic operations

b)

To convert data types

c)

To display text in the console

d)

To create programs

8.

What is the correct way to calculate the remainder of dividing two numbers in Python?

a)

number1 % number2

b)

number1 / number2

c)

number1 * number2

d)

number1 - number2

9.

What is the purpose of the 'int' function in Python?

a)

To convert a number to a string

b)

To convert a string to a number

c)

To perform integer division

d)

To calculate the remainder

10.

What is the purpose of the 'float' function in Python?

a)

To convert a number to a string

b)

To convert a string to a number

c)

To perform integer division

d)

To calculate the remainder