wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Inputs and Variables

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

Which function is used to accept data as input at run time?

a)

output()

b)

print()

c)

int()

d)

input()

2.

Which of the following functions display an output to the screen?

a)

display()

b)

output()

c)

print()

d)

post()

3.

Which code produces the following output? Hello

a)
b)
c)
d)
4.

What is a input?

a)

A function that allows us to ask the user to enter some data.

b)

To plug in something.

c)

Data displayed on a screen.

d)

A user-defined function

5.

In Python3, Whatever you enter as input, the input() function converts it into a string

a)

True

b)

False

6.

Which of the following input commands would allow the user to receive and store an integer from the keyboard?

a)

integer = input("Please enter an integer:")

b)

integer = int(input("Please enter an integer:"))

c)

integer = float(input("Please enter an integer:"))

d)

integer = bool(input("Please enter an integer:"))

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.

What is the term for an error that a programmer makes in their code so the program won't run?

a)

Program error

b)

Syntax error

c)

Code error

d)

Logic error

9.
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
10.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
11.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
12.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!