Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Variables & Conditional Statements

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What function is used in Python to get users input or response?

a)

input

b)

input<>

c)

input()

d)

INPUT()

2.
The correct way to write a variable in Python?
a)

favnum = 10

b)

fav num = 10

c)

fav num is 10

d)

favnum == 10

3.

What symbol is used in python to assign values to a variable?

a)

:

b)

*

c)

=

d)

==

4.

What will be printed?

animal = ("frog")

place = ("pond")

print("The", animal, "jumped into the", place)

a)

Nothing will print

b)

The animal jumped into the place

c)

The "frog" jumped into the "pond"

d)

The frog jumped into the pond

5.

What is the difference between an input statement and a print statement?

a)

input() requires a response from the user. print() displays output.

b)

there is no difference

c)

input() displays output. print() requires a response from the user.

6.

Which is the best way to ask the user for a number so you can use it later?

a)

num = input(“Enter a number: ” )

b)

num = input (“4” )

7.

laptops=36

What is the name of the variable?

a)

laptops

b)

=

c)

36

d)

variable

8.

greeting = ("Hello World")

What is the value of the variable?

a)

greeting

b)

=

c)

Hello World

d)

there is no value

9.

What will be printed?

a)

A

b)

B

c)

3

d)

4

10.

What will be printed if the user enters 7?

a)

47

b)

7

c)

winner!

d)

you didn't win