Python Functions and Exceptions Review

Flashcard
•
Computers
•
9th - 12th Grade
•
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
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Functions and Parameters

Flashcard
•
9th - 12th Grade
11 questions
2832 and 6861 Programming Flashcard

Flashcard
•
9th - 12th Grade
14 questions
Javascript Control Structures Practice

Flashcard
•
9th - 12th Grade
12 questions
Python Functions

Flashcard
•
9th - 12th Grade
12 questions
Python Functions

Flashcard
•
9th - 12th Grade
11 questions
AP Computer Science Principles Unit 3

Flashcard
•
10th - 12th Grade
12 questions
CS Python Fundamentals Unit 4 Review

Flashcard
•
9th - 12th Grade
13 questions
Python variables, expressions, and data types

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade