Updated code

This commmit added some better practises for this program. Such as localizing variables, it's sure is important. Otherwise I can hack into your program and let it error out, this way you are sure that never will happen.
I also changed some string.lower(str) to str:lower() since it's shorter, no real advantage there.
Merge pull request #101 from EngineerCoding/patch-1

Updated code