Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Term 1 - Python Functions - W11 - Quiz1

Python quiz

Uploaded by

S Alejtebi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Term 1 - Python Functions - W11 - Quiz1

Python quiz

Uploaded by

S Alejtebi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Term 1 – Python Functions – W11- Quiz1

• What is a function in Python, and why are functions used?

• How do you define a function in Python? Can you give a simple example?

• What are parameters and arguments in the context of functions?

• What is the difference between a function that returns a value and one that does not?

• How can you call a function in Python after defining it?

• What is a default parameter in a function, and how do you use it?


• Can you explain what a return statement does in a function?

• What happens if you forget to include a return statement in a function that is


supposed to return a value?

• What are keyword arguments, and how do they differ from positional arguments?

• How can you define a function that accepts an arbitrary number of arguments?

• How do you document a function in Python? Why is documentation important?

• Can you explain what a lambda function is and when you might use it?
• What is the scope of a variable defined inside a function? Can it be accessed outside
the function?

• How can you pass a list to a function and modify its contents?

You might also like