
Python Functions Flashcard
Flashcard
•
Education
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

50 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What will be the output of the following code?
```python
def add(a, b):
return a + b
result = add(5, 3)
print(result)
```
Back
8
2.
FLASHCARD QUESTION
Front
What will the following code output?
```python
def multiply(x, y):
return x * y
result = multiply(4, 3)
print(result)
```
Back
12
3.
FLASHCARD QUESTION
Front
What will be the output of the following code?
```python
x = 10
def func():
x = 5
return x
print(func())
print(x)
```
Options: 5 10, 10 5, 5 5, 10 10
Back
5 10
4.
FLASHCARD QUESTION
Front
Which function demonstrates recursion?
def factorial(n):
if n == 1:
return 1
else:
return n * factorial(n - 1)
Back
factorial
5.
FLASHCARD QUESTION
Front
What is the output of the following code?
```python
def func(a, b=3):
return a * b
result = func(4)
print(result)
```
Back
12
6.
FLASHCARD QUESTION
Front
Which of the following statements about recursion is true?
```python
def count_down(n):
if n == 0:
return
else:
print(n)
count_down(n-1)
```
Options: Recursion will never terminate, Recursion is only valid for integer inputs, The function will print numbers from n down to 1, Recursion terminates before printing
Back
The function will print numbers from n down to 1
7.
FLASHCARD QUESTION
Front
What does this code output?
```python
def test(x):
return x + 2
x = test(10)
print(x)
```
Back
12
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
50 questions
Network Security Flashcard
Flashcard
•
University
35 questions
Motion in Two Dimensions
Flashcard
•
12th Grade
37 questions
Grade 11 CAT
Flashcard
•
11th Grade
41 questions
Use Photography for Multimedia Project
Flashcard
•
KG - University
50 questions
SINGLE AWARD PHYSICS FLASHCARD
Flashcard
•
12th Grade
42 questions
Overview of the Internet and Key Concepts
Flashcard
•
University
44 questions
EDEXCEL PSYCHOLOGY UNIT 1: WPS01
Flashcard
•
Professional Development
50 questions
UIT 1111 (COPTPA) 2.2
Flashcard
•
KG - University
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