
ONE 6th FORM Python code and pseudocode
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Lorna Jarrett
Used 2+ times
FREE Resource
Enhance your content in a minute
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does the code calculate, and how would you comment on the base case in Python?
The code calculates the sum of numbers; the base case avoids infinite recursion.
The code calculates the factorial of a number; the base case stops recursion.
The code calculates the square of a number; the base case simplifies the calculation.
The code calculates powers of a number; the base case ensures all numbers are included.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Modify the pseudocode to calculate the cubes instead of the squares. Which of these changes is correct?
Replace OUTPUT i^2 with OUTPUT i^3.
Add SET cube TO i^3 above the OUTPUT line.
Replace FOR i FROM 1 TO 10 DO with FOR i FROM 1 TO 100 DO.
Replace OUTPUT i^2 with OUTPUT i*i.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you add a comment explaining the purpose of the modulus operator in Python?
# The modulus operator (%) checks if the number is even or odd.
# The modulus operator (%) adds two numbers.
# The modulus operator (%) finds the square root of a number.
# The modulus operator (%) divides a number and rounds down.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Write a comment for the Python code explaining the purpose of the loop.
# This loop adds all names to a list called names.
# This loop counts the number of people in the list.
# This loop greets each person by printing their name.
# This loop calculates the total length of all names.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you comment the line total += num to explain what it does?
# Checks if num is greater than the total variable.
# Divides the total by num and updates it.
# Multiplies num by the total and prints it.
# Adds the value of num to the total variable.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of decision-making structure is used, and how could you comment it effectively?
# A loop structure that checks numbers.
# An if-elif-else decision structure to classify the number.
# A recursive function that compares numbers.
# A conditional statement that calculates square roots.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you comment the line if command == "exit": to explain its purpose?
# Checks if the user wants to terminate the loop.
# Skips the next iteration if "exit" is entered.
# Ends the program immediately after this line.
# Runs an infinite loop when "exit" is entered.
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
15 questions
ONLINE Quiz - Computer Hardware Basics (COMSYS 1)
Quiz
•
12th Grade
14 questions
TCP/IP & other protocols [A Level]
Quiz
•
12th Grade
10 questions
MIL-MODULE 2 QUIZ #3
Quiz
•
12th Grade
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
14 questions
Bài 29. Nhận biết lỗi chương trình
Quiz
•
9th - 12th Grade
8 questions
Overview of IT
Quiz
•
6th Grade - University
15 questions
4.6.4 Logic Gates
Quiz
•
10th Grade - Professi...
12 questions
Wee Word Intro
Quiz
•
7th - 12th Grade
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
