WorksheetsPython Basics
Total questions: 30
Worksheet time: 29mins
print(Hello world!)
print("Hello world!")
print(3+4)
print("3+4")
What will the output be from the following code?
print("Hello world!\nHello world!") (aka new line)
Hello world! Hello world!
Hello world!
Hello world!
SyntaxError
Hello world!
What is syntax?
Syntax is the word used to describe an error
Syntax is the rules of the programming language
It is used to read information
It is used to output information
print("Hello" + "world!")
print("Hello" + "world" + "today")
What symbol is used in python to assign values to a variable? x=coat
equals =
plus +
forward slash /
asterisk *
name = 'Dave'
print (name)
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
Good morning 'Dave'
Good morning Dave
Good morning name
Good morning + Dave
What would be an example of an integer or whole number?
4
2.5
7.4
9.4
Everything that we want do display in a print() function must:
be inside parentheses - ()
quotation marks - ""
be inside single quotation marks - ''
be inside hash marks - #
Comments are added in programming to explain what's going on in the code. The computer does not recognize comments. How do you start a comment?
With a ?
With a #
With an !
With a &
In Python, variables are black, functions are purple and strings are green? True or False
True
False
