Exercises

Create a new file called function_exercises.py and do the following:

  1. Create a function rect_perimeter that takes two arguments, length & width and returns the perimeter

  2. Create a function rect_area that takes two arguments, length & width and returns the area.

  3. Create a function super_hi that takes a name as an argument and returns 'Hi' plus the name in all capital letters For e.g. super_hi('Joanna') returns HI JOANNA, super_hi('Safiya') returns HI SAFIYA. Use the function upper() on a string, e.g. 'test'.upper().

Last updated