Functions

Reuse code with parameters, defaults and return values.

A function gives a block of code a name, so you can use it again and test it on its own.

Expected output
180.0
50.0
60.0

print() shows a value to a person. return hands it back to your code. A function with no return gives back None.

Many arguments

Expected output
60

Lambda

A small unnamed function, often used as a sort key.

Expected output
[('Bala', 19), ('Chitra', 21), ('Asha', 22)]
โ† Dictionaries and setsErrors and files โ†’