NEW
Font size
WorksheetsPython Basics
Total questions: 15
Worksheet time: 9mins
How would you print a text string?
output "Hello!"
print ("Hello!")
print (Hello!)
output (Hello!)
x = 5
y = 6
print("x*y")
The code above displays the following:
11
x*y
Syntax Error
30
A data type that can have one of two values: True or False
boolean
variable
modulo
interpreter
Integers are ____________ and floats are _____________
whole numbers and exponents
powers and fractions
fractions and whole numbers
whole numbers and decimal numbers
name = 'Dave'
print (name)
Which one is NOT a valid variable name?
my_var
myvar
_myvar
my var
Variable names can start with...
...only capital letters.
...any number, letter or an underscore (_).
...any letter or symbol.
...any letter or an underscore (_).
a = 30
b = 20
print(a-b)
20
10
50
90
which one of these variable is wrong?
_what = 'hello world'
1what = 'hello world'
what = 'hello world'
what will be the answer of this question
Num = 90
Num = 20
print(Num)
110
100
20
80
What do we use variables for?
for storing data.
for printing commands.
for comment
