wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

KS3 Data Types

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

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

a)

Variables

b)

Constants

c)

Data types

2.

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 result in an error-free output

d)

All of the above

3.

What symbol is used to assign values in Python?

a)

=

b)

==

c)

4.

Which of the following is NOT an integer?

a)

3

b)

-3.2

c)

-3

d)

0

5.

Which of the following is a real number?

a)

3

b)

3.5

c)

-4

d)

All of the above

6.

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

a)

Character

b)

String

c)

Boolean

d)

All of the above

7.

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

a)

Character

b)

Integer

c)

Boolean

d)

All of the above

8.

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: ”))

9.

How much memory is allocated for a Boolean variable?

a)

1 bit

b)

1 byte

c)

2 byte

d)

No limits

10.

How much memory is allocated for a character variable?

a)

1 bit

b)

1 byte

c)

2 byte

d)

No limits

11.

How much memory is allocated for a string variable?

a)

1 bit

b)

1 byte

c)

2 byte

d)

No limits

12.

What is the output of this code in Python?

num=float(45)

print("num= ",num)

a)

num=45

b)

num=45.0

c)

num=45.00

d)

num=45.000

13.

What is the output of this code in Python?

num=float(45)

print("num= %.3f“ %num)

a)

num=45

b)

num=45.0

c)

num=45.00

d)

num=45.000

14.

What symbol is used to add comments in Python?

a)

#

b)

%

c)

//

d)

!

15.

What happens when this Python program is executed?

mark= 62.5

subject=‘Maths’

print(subject + mark)

a)

‘Maths 62.5’ is printed

b)

'Maths + 62.5’ is printed

c)

Type error occurs

16.

Which of the following statement is CORRECT about dim statement?

a)

Dim statement declares a variable only

b)

Dim statement declares multiple variables of same data type only

c)

Dim statement declares multiple variables of different data types