
Python-Recap 1
Quiz
•
Instructional Technology
•
9th - 12th Grade
•
Practice Problem
•
Medium
Zubaidah Shaheen
Used 3+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which Python code segment will display “Hello, world!” on the screen?
"Hello, world!"
print "Hello, world!"
print("Hello, world!")
display Hello, world!
Answer explanation
The correct choice is 'print("Hello, world!")' because it uses the print function with parentheses, which is the proper syntax in Python 3 to display text on the screen.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does the following Python code display?
print("Hello")
print("World")
HelloWorld
Hello
World
Hello World
World
Hello
Answer explanation
The code prints 'Hello' on one line and 'World' on the next line. Therefore, the output is 'Hello' followed by 'World', making the correct answer 'Hello' and 'World'.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What type is the following variable?
x = "Hi there"
float
integer
boolean
string
Answer explanation
The variable x is assigned the value "Hi there", which is enclosed in double quotes. This indicates that x is a string type, as strings are sequences of characters. Therefore, the correct answer is string.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the type of the variable x in the following Python program?
x = input("Enter something: ")
integer
string
float
boolean
Answer explanation
In Python, the input() function always returns data as a string, regardless of what the user enters. Therefore, the variable x will be of type string.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What can you use to make the user enter numbers?
int(input("enter a number"))
print(int("enter a number"))
input("enter a number")
int(input "enter a number")
Answer explanation
The correct choice, int(input("enter a number")), combines input() to prompt the user and int() to convert the input string to an integer, ensuring the user enters a number. The other options are incorrect or incomplete.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Keyboards
Quiz
•
1st - 9th Grade
10 questions
introduccion a Lenguaje C#
Quiz
•
7th - 9th Grade
10 questions
Les Tableurs ( Microsoft Excel ) 1
Quiz
•
6th - 12th Grade
10 questions
Vui chơi có điểm - Tin học 9
Quiz
•
6th - 9th Grade
10 questions
Scratch
Quiz
•
5th - 9th Grade
10 questions
C# Консультация. Повторение
Quiz
•
9th - 12th Grade
10 questions
1ºPRIMARIA-REPASO POSICION DE MANOS
Quiz
•
1st Grade - University
10 questions
Media and Information Literacy
Quiz
•
1st Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Instructional Technology
20 questions
El Verbo IR Practice
Quiz
•
9th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
10 questions
Theme
Quiz
•
9th Grade
20 questions
Cell Organelles
Quiz
•
10th Grade
12 questions
Exponential Growth and Decay
Quiz
•
9th Grade
