wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ALPro 3 - Variable and Data Type

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

Which value is a String?

a)

64

b)

"cat"

c)

True

d)

0.5

2.

Which of the following is not a correct variable type?

a)

float

b)

real

c)

int

d)

char

3.

Which one of the following is not a valid identifier (variable name)?

a)

_examveda

b)

1examveda

c)

exam_veda

d)

examveda1

4.

Identify the data type of true

a)

int

b)

boolean

c)

String

d)

double

5.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
6.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
7.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
8.

Which of the following code is a Python Comment?

a)

#this is a comment

b)

{ this is a comment }

c)

" this is a comment "

d)

( this is a comment )

9.

The statement input allows us to:

a)

input values to the code

b)

Read what the user typed

c)

order the imported statements

d)

show there name

10.

What would print 10 + 16 x 2 produce?

a)

62

b)

72

c)

52

d)

42

11.

name=input("What is your name? ")

print("Your name is " + name)

What will be displayed if the user types in "Bob"?

a)

Your name is name

b)

name

c)

Bob

d)

Your name is Bob

12.

Which of the following would be an example of a float variable:

a)

ValidInput = False

b)

GuessCount = 100

c)

Name = "Bilbo"

d)

Pi = 3.14159265359

13.

Python is the fastest growing programming language:

a)

True

b)

False

14.

What would be the result of 3 ** 3

(a)  

15.

What would be the result of 9 // 7

(a)  

16.

What would be the reult of 9 % 7

(a)