This is my chapter 4 funtion exercise 6-hourpay:
This is my chapter 4 funtion exercise 7-computegrade:
This is another program for computegrade with some differences compared with the above:
Reflection: During the process of working on exercise 7, I realized that when I wanted to add the conditional execution of try-except to the function, the print part could be a problem if I did not also return the value of the message such as “Please enter a numeric number”. Then I learned that “return” could also be used for string type, so I finally also returned these sentences in the function. And I also has a question that is it better to put sentences in the function area as many as possible instead of putting them in the program? That’s why I posted two programs for exercise 7.