Ukuran huruf
Lembar kerjaIntroduction to Python Quiz
Total soal: 52
Worksheet time: 34mins
To output hello world! which would be the correct python line of code
output("Hello World!)
Print("Hello World!)
print("hello world!")
print("hello world")
What is the variable in the code shown
variable
Name
name
Pick a syntax error in the code
Capital P for print
Missing brackets
Missing comma
Missing speech marks
What is the output of the following code if raining was entered
Take a brolly!
Have a great day
The code would not run
What is the output of the following code if Raining was entered
Take a brolly!
Have a great day
The code would not run
If you have a syntax error will the code run?
Yes
No
What will be the output?
name = "Dave"
print (name)
What is the name of the site that we use to write programs and then test them out?
Online Python
print(3+4)
print("3+4")
A computer ________________ is a detailed, step-by-step set of instructions telling a computer exactly what to do.
program
algorithm
function
language
Which 2 data types have we been using?
String
list
float
Integer
Which line of code would output the following:
What are the 2 rules for creating a variable name?
A variable name cannot start with a number
A variable name must begin with a capital letter
A variable name must not contain any spaces
A variable name must not be more than 5 characters in length
What is the name of the variable in this Python code
name
input
("What is your name")
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
What does == mean?
Assign a value to a variable
Nothing, it's an error caused by typing == instead of =
Check that the value on the right of the == matches the value on the left
What can a variable not start with?
A special character
A capital letter
A number
A lower case letter
What is the name of the variable in this program?
colour
input
" "
What will this code print?
access denied
access granted
error
password
If the user enters 60, what is the output?
You are old!
You are middle-aged!
You are young!
Error message
if age is less than 20 then
What symbol must you place at the end of an if statement?
)
:
;
}
float, integer, boolean, and string are all examples of what?
Variables
Data Types
Words
Concatenation
Which of the following name will be a good practice if i want to store my age in variable?
Prada
Age
Name
FIFA
if age is less than 20 then
1==0
True
False
What is an indentation in Python?
A line of code that returns a value
A subroutine
A block of code that creates a variable
A code block (body of a function, loop etc.) starts with indentation and ends with the first unintended line.
What is the purpose of the tab key in Python programming?
To save the file
To run the program
To indent a line
To delete a line
What is a definition of SELECTION?
A variable expression
A precise set of step-by-step instructions written in a programming language
When the program checks the conditions and chooses the path based on the outcome
Which condition represents 'X is greater than Y'
X == Y
X > Y
X < Y
Why is there an error in Line 1 of the code?
No brackets
No speech marks
print should be changed to input
Brackets should be square
Why is there an error in line 6 of this Python code?
No speech marks
No brackets
No full stop
No comma
What is the missing instruction?
(print)
"Print"
