
Python Functions Quiz

Quiz
•
Computers
•
University
•
Hard
Vigneshwari S
FREE Resource
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()
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
Struktur Data

Quiz
•
University
50 questions
Dasar Program Keahlian

Quiz
•
University
50 questions
Ôn tập CK 2

Quiz
•
10th Grade - University
45 questions
Microsoft Excel - Basics

Quiz
•
7th Grade - University
50 questions
UNESCO LS6 Digital Citizenship

Quiz
•
12th Grade - University
55 questions
Linux Test Prep 2

Quiz
•
8th Grade - Professio...
50 questions
DSA - Infosys Power Programmer

Quiz
•
University
49 questions
MATLAB Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University