
Python Return, Pass, Try and Except
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Mark Molina
Used 9+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Maria is writing a function that calculates the area of a rectangle and wants to use the result in another part of her program. Which statement should she use?
return
pass
continue
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
John created a function that calculates the sum of two numbers, but when he calls the function, it doesn't give any output. What is the most likely reason?
He forgot to include a return statement.
He used pass instead of return.
He placed the return outside the function.
He didn't use print.
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Lisa is defining a function but hasn’t decided what it should do yet. What should she use to avoid syntax errors?
return
continue
pass
break
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Kevin is writing a for loop but doesn’t want it to do anything for now. What should he write inside the loop?
return
print("Skipping")
pass
break
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Emma's program asks the user to enter a number, but it crashes when someone types letters instead. What should she use to prevent this?
return
try and except
break
pass
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
A teacher wants to create a function that calculates the average score of students and sends the result to another function for grading. What should the function include?
print(score)
return score
pass
break
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Why is it a best practice to use TRY?
It makes debugging easier.
It ensures the entire program is inside a try block.
It prevents syntax errors.
It avoids using return.
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
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
10 questions
COMPUTER PROGRAMMING Q2_FLOWCHART (2 points each)
Quiz
•
11th - 12th Grade
9 questions
OCR GCSE CS - 2.1 ERL sorts and searches
Quiz
•
10th - 11th Grade
15 questions
CSS Quarter IV QUIZ 2
Quiz
•
10th Grade
10 questions
Quiz 5 - Excel
Quiz
•
11th Grade
13 questions
Stepwise Refinement
Quiz
•
11th - 12th Grade
15 questions
# REVIEW 1 DATA TYPES
Quiz
•
10th Grade
11 questions
HEALTH AND SAFETY 9
Quiz
•
7th - 9th 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
