Python Programming Basics Practice Test: Python Functions — Flashcards | Python | FatSkills

Python Programming Basics Practice Test: Python Functions — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

Python functions are defined using the def keyword, followed by the function name and parentheses. The parentheses can be empty, or they can contain a list of arguments. The body of the function is indented, and the function ends with the return keyword, followed by the value that the function should return.
You can also define functions that do not return any values. These functions are typically used to perform some action, such as printing a message to the console. 

- Define the code that it will process each time you call it
- Specify the values to return (if any) when you call the function
- Take arguments
- Contain comments

Related test: Python Programming Basics Practice Test: Python Built-in Functions 

1 of 22 Ready
Which of the following is the use of function in python?
Functions are reusable pieces of programs
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password