
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.
Similar Resources on Wayground
10 questions
C++
Quiz
•
9th - 12th Grade
10 questions
Latihan Pra PTS Genap
Quiz
•
10th Grade
10 questions
contoh sensor berbasis kapasitansi
Quiz
•
12th Grade
9 questions
Microbit y Phyton Quiz
Quiz
•
11th Grade
10 questions
Komponen Pneumatik
Quiz
•
11th Grade
10 questions
MYSQL
Quiz
•
10th Grade
10 questions
Basic Ms Excel
Quiz
•
9th Grade
10 questions
Teknik Otomasi Industri
Quiz
•
11th Grade
Popular Resources on Wayground
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
15 questions
Solving Equations with Variables on Both Sides Review
Quiz
•
8th Grade
Discover more resources for Instructional Technology
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
25 questions
Preterito regular
Quiz
•
10th - 12th Grade
20 questions
Cell organelles and functions
Quiz
•
10th Grade
10 questions
hands washing
Quiz
•
5th - 12th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
20 questions
Punnett Squares and Genetics
Quiz
•
9th Grade
