Python Functions and Exceptions Review
Flashcard
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Which of the following is the correct way to declare a function in Python? Options: print_hello: print("hello"), function print_hello(): print ("hello"), print_hello(): print("hello"), def print_hello(): print("hello").
Back
def print_hello(): print("hello")
2.
FLASHCARD QUESTION
Front
Which of the following code samples correctly passes the number 10 as an argument to the function print_number? Options: print_number(10), print_number() print 10, 10(print_number), print print_number print 10
Back
print_number(10)
3.
FLASHCARD QUESTION
Front
Consider this code snippet. Which of the following additional functions could be safely added below this code, without causing an error?
Back
4.
FLASHCARD QUESTION
Front
Which of the following functions successfully returns the number 10?
Back
5.
FLASHCARD QUESTION
Front
What type of error occurs when a program is expecting an integer value and the user enters a string?
Back
ValueError
6.
FLASHCARD QUESTION
Front
Why do programmers use try and except statements when their code might throw an exception?
Back
To handle exceptions gracefully and either handle the error or print out a useful error message.
7.
FLASHCARD QUESTION
Front
Which of the programs below will print the following output?
I would like a green balloon.
Back
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
11 questions
Unit 1 | Topic 2 | Key Terms - Flashcards
Flashcard
•
9th - 12th Grade
10 questions
2025 S3/4 CCKS Enzymes
Flashcard
•
8th Grade - University
8 questions
MAT_8_EF_QN01-QN08
Flashcard
•
8th Grade - University
15 questions
Function Operations and Composite Functions
Flashcard
•
9th Grade - University
15 questions
Unit 4 Test Review
Flashcard
•
10th Grade - University
10 questions
Twelfth Night
Flashcard
•
10th Grade
10 questions
Disney descendants flashcard
Flashcard
•
KG
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade