WorksheetsBSIT 2 - Python Basics
Total questions: 25
Worksheet time: 12mins
To display something on the screen, use this command:
print()
Print()
screen()
write()
display()
To display the following on screen
Hello World!
the following command should be used:
print(Hello World!)
print("Hello World!")
print("Hello World" + !)
print"(Hello World!)"
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
x = 5
y = 6
print("x*y")
The code above displays the following:
11
x*y
Syntax Error
30
x = 5
y = 6
print(x*y)
Select the correct answer(s):
x is a variable
x is a value
print() is a funciton
age = input("Enter Age (as integer): ")
newAge = age + 20
print ("your age in 20 years is:", newAge)
you enter
15
value of age is 15
value of newAge is 35
output is: your age in 20 years is: 35
value of age is 15
value of newAge is 20
output is: your age in 20 years is: 20
value of age is 15
value of newAge is "age + 20"
output is: your age in 20 years is: 35
value of age is 15
value of newAge is 35
output is: your age in 20 years is:35
Operators used in python:
divide, multiply, add, subtract
/, *, +, -
div, mul, +, -
\, x, +, -
~, *, +, -
name = 'Dave'
print (name)
Which is the Python logo?
What is a input?
A function that allows us to ask the user to enter some data.
To plug in something.
Data displayed on a screen.
A function
What is a output?
A piece of data that is shown on the screen.
Data that the user enters
An output
A orange
What function is used to output a message in python?
print("")
input=name
name=input
What syntax would you use to create a name variable?
name=input()
input=name
name=input{}
name=INPUT
A _____________ expression is an expression that is either true or false.
boolean
truth
variable
conditional
