This Python Methods and Functions Quiz helps you understand how functions and methods work in Python, how they differ, and how they’re used in real coding scenarios. Master function syntax, built-in methods, user-defined functions, and more.
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
What is the main difference between a function and a method in Python?
Correct
Incorrect
Question 2 of 15
2. Question
Which keyword is used to define a function in Python?
Correct
Incorrect
Question 3 of 15
3. Question
What does this code print?
def greet(): return “Hello” print(greet())
Correct
Incorrect
Question 4 of 15
4. Question
Which of the following is a built-in method for strings?
Correct
Incorrect
Question 5 of 15
5. Question
Can a Python function return multiple values?
Correct
Incorrect
Question 6 of 15
6. Question
What will print(“hello”.capitalize()) output?
Correct
Incorrect
Question 7 of 15
7. Question
Which statement is used to exit a function and optionally return a value?
Correct
Incorrect
Question 8 of 15
8. Question
What is the output of the following?
def add(a, b=2): return a + b print(add(3))
Correct
Incorrect
Question 9 of 15
9. Question
Which of these is a method used with list objects?
Correct
Incorrect
Question 10 of 15
10. Question
Which of the following is a valid function definition?
Correct
Incorrect
Question 11 of 15
11. Question
What does list.sort() do?
Correct
Incorrect
Question 12 of 15
12. Question
Can functions be passed as arguments to other functions?
Correct
Incorrect
Question 13 of 15
13. Question
What is the output?
def func(): pass print(func())
Correct
Incorrect
Question 14 of 15
14. Question
What does str.strip() do?
Correct
Incorrect
Question 15 of 15
15. Question
What is a function with no name called?
Correct
Incorrect
Summary
These Python Method and Function MCQs help learners distinguish between user-defined functions and object-specific methods. Mastering this topic is crucial for clean, reusable, and modular Python code.
At QuizOrbit, our team specializes in fun, informative quizzes across topics like general knowledge, technology, and entertainment. Boost your knowledge with our expert-designed quizzes.