Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 737 Bytes

03-exercises.md

File metadata and controls

19 lines (10 loc) · 737 Bytes

Exercises for Session 3

Functions

  • Exercise 1: Write a function that takes one (numeric) argument and adds 1 to the provided number.

  • Exercise 2: Extend the function to add any user specified number instead of only 1.

  • Exercise 3: Improve the robustness of the function to validate that the argument are the correct type (e.g., in this case numeric).

  • Exercise 4: Write meaningful error messages in case the a user tries to add a number to a character.

  • Exercise 5: Write some tests for your function.

Loops

  • Exercise 6: Write a for loop that returns numbers 1 to 5.

  • Exercise 7: Write a for loop that concatenates numbers 1to 5 with a user specified prefix or suffix e.g., idea_1, idea_2, idea_3 ...