
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
38 questions
Cyber Security Networking Challenge
Flashcard
•
12th Grade
40 questions
Website Design and Analytics Flashcard
Flashcard
•
11th Grade
47 questions
Mathematical Problems and Solutions
Flashcard
•
University
48 questions
LOGIKA KALIMAT BERTINGKAT DAN KUANTOR
Flashcard
•
University
44 questions
1.4.3 Boolean Algebra
Flashcard
•
12th Grade
39 questions
diritto commerciale
Flashcard
•
University
39 questions
ITC: Unit 3-6 Review
Flashcard
•
University
50 questions
3.2.3.4 and 4.2.6.3 The balance of payments
Flashcard
•
12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Education
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University