
Python Functions Quiz
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Vigneshwari S
Used 1+ times
FREE Resource
Enhance your content in a minute
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? def greet(name): return "Hi " + name print(greet("Alex"))
Alex
Hi Alex
greet Alex
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a function has no return statement, it returns:
0
None
Empty string
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to define a function in Python?
func
def
function
define
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a function call?
def myfunc()
myfunc()
function myfunc
func myfunc
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output? def add(a, b): return a + b print(add(2, 3))
23
5
(2, 3)
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Positional arguments must be:
Passed in order
Always keyword arguments
Optional always
Declared after *args
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function returns the length of a string?
size()
len()
count()
length()
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
49 questions
Quiz on C Operators
Quiz
•
University
45 questions
Luyện tập trắc nghiệm MS Word 2016 (Bài 02)
Quiz
•
University
49 questions
sal vize
Quiz
•
University
50 questions
MES3093: QUIZ
Quiz
•
University
48 questions
OSI Layer
Quiz
•
12th Grade - University
50 questions
EXcel varios
Quiz
•
University
50 questions
marketing căn bản
Quiz
•
University
51 questions
EXCEL BASICO
Quiz
•
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
