A couple of days ago I had a particular session with my programming teacher, Ken Bauer, and I asked him to give me feedback on the programs I have been showing you in this blog. He pointed some things out to me, so I decided to redo two of them to show you what I learned. They are not major changes, but it´s the small details that can make a difference!
Anyway, the first change was made to problem number four in quiz # 5. In my original program, I used as options all the vowels both in lower and upper case, but Ken told me I could just change the input into upper case using .upper(), so then I didn’t have to take into account the lower case letters. You can read more about that in this page:
Here is how I modified my program:
And how it ran (just the same as the original one):
The other change I made was to problem number eight, in quiz # 6. I was doing it using a conditional (if the word was the same as its reverse, then the answer was True), but that was not necessary since word == reverse is a boolean expression, and the answer to all boolean expressions is either True or False. So, I could have just done it like this:
And it should run the same as the original: