N5 - Python Recap

Quiz
•
Computers
•
11th Grade
•
Hard
S Johnston
Used 3+ times
FREE Resource
28 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does input("Enter your name: ") do?
Displays your name
Prints a message
Asks the user for input
Creates a variable
Answer explanation
The function input("Enter your name: ") prompts the user to enter their name, effectively asking for input. It does not display or print anything by itself, nor does it create a variable directly.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which line outputs a message to the screen?
input("Message")
print("Message")
message = "Message"
display("Message")
Answer explanation
The correct choice is 'print("Message")' because it is the function used in Python to output messages to the screen. The other options do not display messages: 'input' takes input, assignment does not output, and 'display' is not a standard function.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of: print("Hello" + "World")
Hello + World
Hello World
HelloWorld
Error
Answer explanation
The expression 'Hello' + 'World' concatenates the two strings without any space, resulting in 'HelloWorld'. Therefore, the correct output is 'HelloWorld'.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is wrong with this line? print("Your age is " + age)
Nothing
It needs int(age)
It needs str(age)
The + is incorrect
Answer explanation
The line is incorrect because 'age' is likely an integer. To concatenate it with a string, it needs to be converted to a string using str(age). Thus, the correct choice is 'It needs str(age)'. This allows proper string concatenation.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which input line saves the response in a variable?
print("Enter your name")
input("Enter your name")
name = input("Enter your name: ")
response = print("Enter name: ")
Answer explanation
The correct choice is 'name = input("Enter your name: ")' because it assigns the user's input to the variable 'name'. The other options either do not save the input or use incorrect syntax.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which line assigns the value 12 to a variable?
12 = age
age == 12
age = 12
assign age 12
Answer explanation
The correct line is 'age = 12', which uses the assignment operator '=' to assign the value 12 to the variable 'age'. The other options either use incorrect syntax or do not perform an assignment.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is a string?
"17"
17
True
17.0
Answer explanation
The correct choice is "17" because it is enclosed in quotes, making it a string. The other options are either numbers or a boolean, which are not strings.
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
Python Intro Practice

Quiz
•
9th - 12th Grade
24 questions
اختبار أساسيات البرمجة بلغة البايثون

Quiz
•
7th Grade - University
23 questions
Python Review Questions

Quiz
•
10th - 12th Grade
25 questions
Python Test

Quiz
•
9th - 12th Grade
23 questions
Gmetrix PS Review

Quiz
•
9th - 12th Grade
25 questions
Problem-solving & Program Design

Quiz
•
11th Grade
25 questions
CSP Python Review

Quiz
•
9th - 12th Grade
25 questions
Microsoft Word 2016 - March 12, 2020

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade