What is the output of the following function call def function(name,age=22):
print(name,age)
function('charlie',25)
Functions in Python
Quiz
•
Deepak M
•
Other
•
10th Grade
•
2 plays
•
Medium
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the output of the following function call def function(name,age=22):
print(name,age)
function('charlie',25)
charlie
25
charlie 25
name 25
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Select which true for Python function
A function is a code block that only executes when called and always returns a value.
A function only executes when it is called and we can reuse it in a program
Python doesn’t support nested function
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following are the two main parts of every function in Python?
The function heading and the function body
The function signature and the function corpus
The function signature and the function body
The function head and the function tail
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following function:
def square(num):
num_sqaured=num**2
return num_squared
def square(num):
num_squared=num**2
return num_squared
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following keywords are used to create a loop in Python?
if
for
foreach
loop
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following loop:
for num in range(1,5):
print(num)
1
2
3
4
5
0
1
2
3
4
1
2
3
4
2
3
4
5
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
x = 0
while x < 10:
x = x + 1
What’s the value of x after the above code snippet executes?
0
9
10
11
Explore all questions with a free account
10 questions
Câu lệnh Rẽ nhánh trong Python
Quiz
•
10th Grade
10 questions
INFORMATIKA 10 S2 HAL 029 PA 2
Quiz
•
10th Grade
5 questions
INFORMATIKA 10 S2 HAL 012
Quiz
•
10th Grade
10 questions
Futebol Português
Quiz
•
1st - 12th Grade
10 questions
Lesson 3 Quiz
Quiz
•
9th - 12th Grade
11 questions
Λίστες και Strings σε Python 2.7
Quiz
•
10th Grade
13 questions
Introduction to Python Programming Quiz 9E
Quiz
•
10th Grade - University
14 questions
Intro to Python Programming Quiz 9D
Quiz
•
1st Grade - University
39 questions
Respect and How to Show It
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
10 questions
Human Body Systems and Functions
Interactive video
•
6th - 8th Grade
20 questions
Multiplication Facts
Quiz
•
3rd Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
20 questions
Investing
Quiz
•
9th - 12th Grade
20 questions
Insurance
Quiz
•
9th - 12th Grade
20 questions
Common Grammar Mistakes
Quiz
•
7th - 12th Grade
20 questions
Paying for College
Quiz
•
9th - 12th Grade
15 questions
Central Tendency
Quiz
•
9th - 12th Grade
20 questions
Banking
Quiz
•
9th - 12th Grade