WorksheetsSimple Python SMKIH
Total questions: 20
Worksheet time: 20mins
Name
Class
Date
1.
To create a newline at the end of prompt, you can use which of the following expressions?
a)
\new
b)
\n
c)
\break
d)
\return
2.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
3.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
4.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
5.
What will be the output?
name = 'Dave'
print (name)
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
6.
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
7.
What will the output be from the following code?
print("Hello world!\nHello world!")
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
8.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information
9.
What will the output be from the following code?
print(Hello world!)
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
10.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
11.
What will the output be from the following code?
print("Hello world!" * 2)
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
12.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
13.
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
a)
John
b)
Rob
c)
Bob
14.
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
a)
John
b)
Rob
c)
Bob
d)
Error
15.
What are the names of the two types of mode that are used in Python? Select two.
a)
Interactive mode
b)
Scratch mode
c)
Imperial mode
d)
Script mode
16.
What is the name of this symbol (>>>)?
a)
Chevrons
b)
Hash tags
c)
Colon
d)
Semi Colon
17.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
18.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
19.
What is a folder?
a)
the name given to a set of recorded information
b)
the name given to the place where files that can be bought
c)
the name given to the place where files that can be stolen
d)
the name given to the place where files that can be stored
20.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.
a)
True
b)
False
100 %
