
Python_Quiz_1
Authored by Marvin Chua
Computers
Professional Development
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the extension of a Python file?
.pyc
.py
.python
.pf
2.
MULTIPLE SELECT QUESTION
20 sec • 1 pt
What is the correct syntax to output "Bye, World" in Python?
echo("Bye, World")
print("Bye, World")
printf("Bye, World")
print('Bye', 'World', sep=', ')
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Is Python compiled or interpreted?
Compiled
Interpreted
Both
Answer explanation
When you first run a Python script, it is converted to bytecode. This process is called compilation.
Python then executes the bytecode. This process is called interpretation.
Thus, Python is a hybrid language.
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following functions can convert a string to a float in Python?
str()
int()
float()
bool()
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the output of the following code?
print(type(10))
<class 'int'>
type(10)
<class 'str'>
"10"
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is used to define a function in Python?
func
function
def
define
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the output of the following code?
scores = [97, 98, 99, 100]
print(scores[0:3])
[97, 98]
[97, 98, 99]
[97, 98, 99, 100]
scores[0:3]
Answer explanation
When you use index slicing, such as scores[0:3]
you are getting the elements from index 0 to index 2.
In other words, from 0 (inclusive) to 3 (exclusive)
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
SQL Commands - SELECT Statements
Quiz
•
Professional Development
10 questions
Day 3 C Programming quiz
Quiz
•
Professional Development
10 questions
Bedrock Immersion Day Quiz
Quiz
•
Professional Development
11 questions
Types of Mass Media
Quiz
•
10th Grade - Professi...
17 questions
Volume 2
Quiz
•
Professional Development
10 questions
Friday Fun
Quiz
•
Professional Development
12 questions
Guess the Gaming Pet 1
Quiz
•
KG - Professional Dev...
11 questions
Technology Morning Tea Quiz
Quiz
•
KG - Professional Dev...
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 Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...