9.1.4 Python Quiz 🐍
Quiz
•
Computers
•
9th Grade
•
Hard
Sofia Mesa Giner
Used 5+ times
FREE Resource
Enhance your content in a minute
48 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following statement output? print("Hello, World!")
a) Error
b) Hello, World
c) HelloWorld
d) Hello, World!
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
🖨️ Which of the following is the correct syntax to print a string in Python?
a) print string("Hello")
b) print(string: "Hello")
c) print("Hello")
d) echo("Hello")
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following statement output? print(123)
a) 123
b) "123"
c) Error
d) 123.0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
📊 Which data type is 3.14 in Python?
a) String
b) Integer
c) Float
d) List
Answer explanation
In Python, numbers with decimal points are considered to be of float type. Integers are whole numbers without decimal points, and strings would be enclosed in quotes.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following statement output? print("Age: " + 20)
a) Age: 20
b) Error
c) Age: +20
d) 20Age:
Answer explanation
Python doesn't allow direct concatenation of strings and integers with the + operator. This will throw a TypeError. To concatenate them, the integer needs to be converted to a string using the str() function.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
🌉 How can we fix the error in the previous question?
a) print("Age: " + str(20))
b) print("Age: " , 20)
c) Both a and b
d) print(20 + "Age: ")
Answer explanation
The error arises from trying to concatenate a string and an integer. We can fix it by converting the integer to a string using str(), or by using commas to separate the items in the print() function, which will print them with spaces in between.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following statement output? print(len("Python"))
a) 5
b) 6
c) Error
d) Python
Answer explanation
The len() function returns the number of items in an object. For a string, it returns the number of characters. The string "Python" has 6 characters.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
45 questions
SAS INFORMATIKA IX SEMESTER 1
Quiz
•
9th Grade - University
50 questions
Ujian Sekolah informatika kelas 9
Quiz
•
9th Grade
46 questions
Ulangkaji ASK T1 Bab 3 Algoritma
Quiz
•
1st - 12th Grade
50 questions
Excel - Hàm
Quiz
•
9th Grade - University
50 questions
SOAL LATIHAN PERSIAPAN PAS GANJIL 9
Quiz
•
9th Grade
50 questions
Asas Sains Komputer Tingkatan 3
Quiz
•
9th - 12th Grade
50 questions
KISI-KISI PAS KELAS 8 SEM GANJIL 2024-2025
Quiz
•
8th Grade - University
50 questions
CUỘC CHIẾN KHỞI ĐẦU 12345
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
