Worksheets9.2 Further programming HWK1
Total questions: 15
Worksheet time: 7mins
Name
Class
Date
1.
What output will the console show, if 15 and 30 are entered by the user?
a)
Syntax error
b)
The sum of the two numbers - 45
c)
The concatenation of the two numbers - 1530
d)
Complier error
2.
What result will display in the shell if 15 and 20 is entered by the user?
a)
"num1 + num2"
b)
1520
c)
35
3.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
4.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
5.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus +
c)
forward slash /
d)
asterisk *
6.
What will be the output?
name = "Dave"
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
7.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
8.
What is Python?
a)
text based programming language
b)
word processor
c)
spreadsheet
d)
block based programming language
9.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
10.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
11.
What will the output be from the following code?
print(3*4+5)
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
12.
What will this code do?
a)
Print Numbers 1-11
b)
Print Numbers 1-10
c)
Print Numbers 2-10
d)
Print Error
13.
Which of the following is a valid way to assign the value 10 to a variable called 'score' in Python?
a)
score : 10
b)
score == 10
c)
score = 10
d)
score <- 10
14.
Which Python command is used to display output to the user?
a)
show()
b)
print()
c)
display()
d)
output()
15.
What is the result of the following code?
num1 = 5
num2 = 8
print(num1 + num2)
a)
58
b)
num1 + num2
c)
Error
d)
13
100 %
