No student devices needed. Know more
31 questions
The rules for putting together a correct computer language statement are called Syntax. Therefore if these rules are broken e.g. no brackets, speech marks etc. it is a...
Syntax error
Logic error
Code error
Run time error
What is the syntax error with this code:
print”Hello World”
No brackets around "Hello World"
Speech marks are not needed
Colon is not needed
print is spelt incorrectly
Print has a capital P
What is the syntax error with this code:
print(“Hello World”);
No brackets around "Hello World"
Speech marks are not needed
Colon is not needed
print is spelt incorrectly
Print has a capital P
What is the syntax error with this code:
Print(“Hello World”)
No brackets around "Hello World"
Speech marks are not needed
Colon is not needed
print is spelt incorrectly
Print has a capital P
What is the syntax error with this code:
prin(Hello World)
No brackets around "Hello World"
Speech marks are not needed
Colon is not needed
print is spelt incorrectly
Print has a capital P
When you run this program what will this line of code do?
name = input("Enter your name: ")
Ask you to Enter your name and save your answer to Google Drive
Ask you to Enter your name and save your answer to My Documents
Ask you to Enter your name
Ask you to Enter your name and save your answer as a variable
What will this piece of code do when it runs for John Smith born in June and the day of his birthday is Tuesday?
print("Hello " + name + "Your birthday month is " + month +
" and the day of your birthday this year is " + day)
"Hello " + name + "Your birthday month is " + month +
" and the day of your birthday this year is " + day
Hello John Smith Your birthday month is June and the day of your birthday this year is Tuesday
Hello John Smith Your birthday month is June and the day of your birthday this year is Monday
"Hello "John Smith "Your birthday month is " + month +
" and the day of your birthday this year is " + day
The word 'Tuesday' is which data type?
String
Real/Decimal/Float
Integer
Boolean
Char
The 3.45 is which data type?
String
Real/Decimal/Float
Integer
Boolean
Char
The letter 'U' is which data type?
String
Real/Decimal/Float
Integer
Boolean
Char
The letter 'FALSE' is which data type that has 2 possible answers?
String
Real/Decimal/Float
Integer
Boolean
Char
The number 45 is what data type?
String
Real/Decimal/Float
Integer
Boolean
Char
This is when you convert a variable value from one type to another.
Casting
Declaring
Masting
Deciding
The code below casts the answer variable from what to what?
answer = 50
print("The answer is " + str(answer))
Float (decimal) to a string
Integer to a string
String to an integer
Float to an integer
The code below casts the answer variable from what to what?
diameter = input("Enter the diameter of the circle ")
pi = 3.14
circumference = float(pi) * float(diameter)
print("The circumference of the circle is: " str(circumference)
Float (decimal) to a string
Integer to a string
String to an integer
Float to an string
number1 = 15
number2 = 10
total = number1 + number2
What is total?
15
10
25
1510
fish = 1.9
chips = 1.1
numberBought = 10
totalCost = (fish + chips) * numberBought
What is totalCost?
1.9
3
30
33
Which is the correct code?
distance = input("Enter the distance travelled ")
time = input("Enter the time taken ")
speed = int(distance) / int(time)
print(“The speed was “ + str(speed))
distance = input("Enter the distance travelled ")
time = input("Enter the time taken ")
speed = str(distance) / int(time)
print(“The speed was “ + str(speed))
distance = input("Enter the distance travelled ")
time = input("Enter the time taken ")
speed = int(distance) / str(time)
print(“The speed was “ + str(speed))
distance = input("Enter the distance travelled ")
time = input("Enter the time taken ")
speed = str(distance) / str(time)
print(“The speed was “ + int(speed))
15>10
TRUE
FALSE
25<12
TRUE
FALSE
Sunday = Sunday
TRUE
FALSE
99 >= 100
TRUE
FALSE
54 <= 67
TRUE
FALSE
45 != 46
TRUE
FALSE
What if the colour entered is red?
colour = input(“Enter the trafficlight colour”)
if colour == “Red”:
print “Stop”
else:
print “Go”
Stop appears on screen
Go appears on screen
Get Ready appears on screen
What if the colour entered is NOT red?
colour = input(“Enter the trafficlight colour”)
if colour == “Red”:
print “Stop”
else:
print “Go”
Stop appears on screen
Go appears on screen
Get Ready appears on screen
To add an option for Amber you need to?
colour = input(“Enter the trafficlight colour”)
if colour == “Red”:
print “Stop”
else:
print “Go”
Enter this before 'else'
elif colour == "Amber";
print(get ready")
Enter this before 'else'
elif colour == "Amber";
print("get ready")
Enter this after 'else'
elif colour == "Amber";
print("get ready")
Enter this before 'if'
elif colour == "Amber";
print("get ready")
number = int(input("Enter a number ")
if number >=10 and number <100:
print("This is a 2 digit number")
elif number >= 100
print("This number has more than 2 digits")
else:
print("1 digit number")
What if 99 was entered?
This is a 2 digit number
This number has more than 2 digits
1 digit number
Something else
number1 = int(input("Enter a number ")
number2 = int(input("Enter a number ")
number3 = int(input("Enter a number ")
If number1 == number 2 or number 2 == number3 or number1 == number 3;
print("At least 2 numbers are the same")
else:
print("no 2 number are the same")
These numbers were entered:
number1 = 12, number2 = 12, number3 = 15
At least 2 numbers are the same
no 2 number are the same
Something else
number1 = int(input("Enter a number ")
number2 = int(input("Enter a number ")
number3 = int(input("Enter a number ")
If number1 == number 2 or number 2 == number3 or number1 == number 3;
print("At least 2 numbers are the same")
else:
print("no 2 number are the same")
These numbers were entered:
number1 = 8, number2 = 9, number3 = 10
At least 2 numbers are the same
no 2 number are the same
Something else
number1 = int(input("Enter a number ")
number2 = int(input("Enter a number ")
number3 = int(input("Enter a number ")
If number1 == number 2 or number 2 == number3 or number1 == number 3;
print("At least 2 numbers are the same")
else:
print("no 2 number are the same")
These numbers were entered:
Number1 = 15, number2 = 15, number3 = 15
At least 2 numbers are the same
no 2 number are the same
Something else
Explore all questions with a free account