Here is Exercise 1:
Here is Exercise 2:
Exercise 1 Thoughts: This one took me a while. First I had to figure out the proper order of the ifs, try/except, and while loop. I needed to put the if and break statement before turning the input into a float. I screwed up my indentation in the try conditional. At one point, it took inputs but always printed the error message in the except loop.
Then I got stuck and went to sleep. The next day, I tried it again with functions, but it was printing something like
I then looked ahead on the schedule and saw that Chapter 8 is about lists. This looked promising. Midway through the chapter, I saw a part about remaking the original summing program and thought that might be useful. I used that to help me write my program.
The one thing I am still confused about is why you need to make a new name for the input for the user. I called it x and then had to give it a new name (value). When I didn’t do this, I had the error messages. I don’t remember doing this in the past.
Exercise 2 Thoughts: I could not come up with a way to do this without lists. So I used one, and based the rest of the code on Exercise 1. This one took a lot less time.