
Python Functions Flashcard

Flashcard
•
Education
•
University
•
Hard
Quizizz 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
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
UIT 1111 (COPTPA) 2.2

Flashcard
•
KG - University
42 questions
Python Final Exam Pointers

Flashcard
•
University
42 questions
A+ Core2 Day 3b Linux Commands

Flashcard
•
Professional Development
50 questions
Basic Computer Knowledge Flashcard

Flashcard
•
University
43 questions
AP Ck CyberSecurity Pre-Test

Flashcard
•
12th Grade
43 questions
AP Ck CyberSecurity Pre-Test

Flashcard
•
12th Grade
47 questions
AP CSP 10 - Python

Flashcard
•
12th Grade
52 questions
Programming II - Python Basics

Flashcard
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade