Please enable JavaScript to use CodeHS

Chapter 4

Functions and Exceptions

4.1 Functions

Functions

Define and Call a Function

Functions and Variables

Two Different X's

Extended Greeting

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Weather

Vocabulary

Term Definition
Indentation Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.
Function body In Python functions, the function body is the indented block of code that comes after the `def my_function():` line. The function body is what will be executed when the function is called.