wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz 1

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

A store your program must use as an identifier to keep track of a value is called a

a)

Algorithm

b)

Variable

c)

Program

d)

Assignment

2.

Which symbol assigns a value to a variable?

a)

/

b)

+

c)

=

d)

" "

3.

What does the print function do in python?

a)

It's a variable.

b)

It can input data.

c)

It displays an output

d)

It loops the code.

4.

What is the output from the following code?

print ("hello world")

a)

Hello World

b)

hello world

c)

print hello world

5.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

6.

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")

7.

The result of this program:

Friday = False

if Friday:

print "Jeans day!"

else:

print "Uniform day"

a)

Jeans day

Today is Friday

Uniform day

Not Friday

b)

Today is Friday

c)

Uniform day

d)

Not Friday

8.

What will the output be from the following code?

print(Hello world!)

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print(Hello world!)

9.

What does the following code do?

myAge = int (myAge)

a)

Converts the var (variable) myAge to a string

b)

Converts the var (variable) myAge to a integer

c)

Converts the var (variable) myAge from a integer to a string

to if statement

d)

Converts the var (variable) myAge

10.

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