wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming revision

Total questions: 16

Worksheet time: 13mins

Name
Class
Date
1.

Complete this sentence: A ………………… data type represents only two values.

a)

Float

b)

String

c)

Character

d)

Boolean

2.

Which of the following data types is used to store several characters?

a)

Character

b)

String

c)

Boolen

d)

Integer

3.

Which of the following is NOT an integer?

a)

3

b)

-3.2

c)

-3

d)

0

4.

What symbol is used to assign values in Python?

a)

==

b)

!=

c)

=

d)

5.

Which of the following is FALSE?

a)

Variable declaration is done at the start of the program

b)

Variable declaration is important to allocate required memory space

c)

Not initialising a variable results in an error-free output

d)

All of the above

6.

Which of the following represents labels that represent values in computer and that can be changed during program execution?

a)

Constant

b)

Variable

c)

Data type

d)

DIV

7.

Which of the following programming construct denotes execution of statements or functions one after another?

a)

Sequence

b)

Selection

c)

Iteration

d)

Order

8.

What programming construct does this diagram represents?

a)

Sequence

b)

Selection

c)

Iteration

d)

Nothing

9.

Which of the following arithmetic operator in Python is used to find remainder of a division operation?

a)

DIV

b)

//

c)

DON

d)

MOD(%)

10.

Complete this sentence: ……………………… is used to execute a particular set of statements repeatedly until a condition is satisfied.

a)

Sequence

b)

Selection

c)

Iteration

d)

All of them or above

11.

Which of the following structure is used to iterate a set of statements by counting the number of times it needs to be executed?

a)

For structure

b)

Do…. While

c)

Repeat… Until

d)

None of above

12.

Which of the following statements is used to typecast a variable that holds string data type?

a)

Variable_name=input(“Enter string value: ”)

b)

Variable_name=Str(input(“Enter string value: ”))

c)

Variable_name=String(input(“Enter string value: ”))

d)

Variable_name=Chr(input(“Enter string value: ”))

13.

What is the output of this code in Python?

num=float(45)

print("num= ",num)

a)

num=45.00

b)

num=45.0

c)

num=45

d)

num=45.000

14.

What symbol is used to add comments in Python?

a)

!

b)

%

c)

#

d)

~

15.

• Input 2 numbers from the user

• Add both inputs together

• Output the result

4 lines
16.

• Input a number from the user

• Double the number input and print the result

• Repeat bullets 1 and 2 until the user enters a number less than 0.

4 lines