wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AstepI Quiz 2

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
2.
What data type would be used for storing someone's telephone numbers?
a)
Float (using a decimal point)
b)
Integer (just whole numbers)
c)
String (alphanumerical data)
3.
what is the code for a STRING in python?
a)
str
b)
stri
c)
stg
4.
What is the output from the following code?print ("hello world")
a)
Hello World
b)
hello world
c)
print hello world
5.
What best defines an IF statement in python?
a)
Is an embedded string with a variable
b)
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
6.
To create a newline at the end of prompt, you can use which of the following expressions?
a)
\new
b)
\n
c)
\break
d)
\return
7.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
8.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
9.
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!
10.

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

d)

Converts the var (variable) myAge to if statement