A look back to my programs

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:

http://stackoverflow.com/questions/9257094/how-to-change-a-string-into-uppercase 

Here is how I modified my program:

quiz5-4corrected

And how it ran (just the same as the original one):

quiz5-4correct-run

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:

quiz6-8corrected

And it should run the same as the original:

quiz6-8correct_run

One thought on “A look back to my programs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s