WorksheetsG5 T3A W2 Intro To Python
Total questions: 27
Worksheet time: 15mins
How can you use the print function in Python as a calculator?
Enclose the mathematical expression in quotation marks within the print function
Directly input the mathematical expression within the print function.
Use the print function with a loop to perform calculations
Assign the result of the calculation to a variable and then print the variable
What will be the output of print(5 + 3)?
7
8
2
10
How can you print multiple items in Python using the print function?
print(item1, + item2, + item3)
print(item1 + item2 + item3)
print(item1, item2, item3)
print(item1 item2 item3)
Can you use the print function to print numbers in Python?
No, the print function only works with strings
Yes, but only if the numbers are within a specific range
Yes, but you need to import a special module to print numbers
Yes
Python is a .......................
webpage
Progrmming languagea
Non programming Language
Snake
What is a variable?
A math operator
An element, feature, or factor that is liable to vary or change.
An if statement
A computer system that can change
What does print("hello) display?
hello
gives you an error
"hello"
"hello
What is a variable?
A math operator
An element, feature, or factor that is liable to vary or change.
An if statement
A computer system that can change
What does print("hello) display?
hello
gives you an error
"hello"
"hello
What does the following code display?
a = 1
b = 2
print(a + a)
2
3
4
22
What is casting?
When you convert a variable value from one type to another.
When you assign a string
When you create a boolean
When you display an integer
'my name' is a valid variable?
No
Yes
Finding and fixing the errors in a program
Indentation
Nesting
Event Block
Debugging
How will the following code look on the screen?
print ("I love programming.")
print ("I love programming.")
"I love programming."
"I love programming."
I love programming.
I love programming.
I love programming. I love programming.
I LOVE PROGRAMMING
I LOVE PROGRAMMING
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
