wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

str vs int

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

What data type is "UB4 9LE"

a)

String

b)

Integer

c)

Character

d)

Float

2.

What is the result of concatenating 'Hello' and 'World' in Python?

word1 = "Hello"

Word2 = "World"

print(Word1 + Word2)

a)

HelloWorld

b)

Hello World

c)

['Hello', 'World']

d)

None of the above

3.

Which data type would be best for storing a person's age?

a)

String

b)

Integer

c)

Float

d)

Boolean

4.

What data type does the following line of code use?

year = int(input("What year is it?")

a)

input

b)

string

c)

integer

d)

number

5.

integers are used to...

a)

display information

b)

complete calculations

c)

gather user input

6.

Strings are used to...

a)

display information

b)

complete calculations

c)

gather user input

7.

Identify the variable that uses strings.

a)

age

b)

currentYear

c)

print

8.

Which line of code uses an integer?

(a)  

9.

Which line of code successfully gathers input as a string?

a)

1

b)

3

c)

5

10.

Which line successfully gathers input for an integer?

(a)