NEW
Font size
WorksheetsPython
Total questions: 40
Worksheet time: 40mins
Which of the following is a command to have a message appear on the screen?
write
msg
input
Pick the Python command used to make the user type in some data (input the data)
get
input
int
float
Which of the following Python command can be used for WHOLE numbers?
input
int
float
What would be printed by the command
print("12-5")
12-5
'12-5'
7
'7'
print(Hello world!)
Below is the code for printing student's name. What is the best answer to put in (?)
name = student
print ( ? )
text
name
student
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
Python has a simple syntax similar to the
coding language
english language
spanish language
Code for Hello, World!
print Hello, World!
print("Hello, World!)
print("Hello, World!")
Insert the missing part of the code below to output
_________________ "My name is ".
Python language use
upper case letters
lower case letters
upper and lower case letters
The output of the program
x = 4
x = "Sally"
print(x)
four
Saly
Sally
print(Hello world!)
It displays an output
print("3+4")
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 is the name of the variable in this program?
colour
input
" "
What will this code print?
access denied
access granted
error
password
What symbol must you place at the end of an if statement?
)
:
;
}
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
How many variables are there in this program?
2
3
4
5
name = "Bob"
if name == "Bob":
print ("Hello " + name)
else:
print ("I dont know you")
Spelling is not important in Python (it will know what you meant to type)
True
False
Which operator performs an addition?
-
+
==
/
What result will display in the shell if 15 and 20 is entered by the user?
"num1 + num2"
1520
35
x = 5
if x > 6 :
print("Hello")
else:
print("Hi")
Hi
Hello
x = 5
y = 6
if x > y or y == 6:
print("Hi")
else:
print("Hello")
Hi
Hello
find the output
print("welcome")
Welcome
welcome
WELCOME
WelCome
