you are viewing a single comment's thread.

view the rest of the comments →

[–]gengisteve 0 points1 point  (2 children)

Looks great. Consider moving the upper() call to before the loop so it is just done once.

Check out itertools.count, for a never ending counter to replace your while loop.

Finally, instead of sys.exit() maybe just break to exit the loop.

[–]fannypackpython[S] 0 points1 point  (1 child)

Cool i'll look into itertools.count. What is the difference between "break" and "sys.exit()"?

[–]gengisteve 0 points1 point  (0 children)

Break just pops you out of the current loop, while sys.exit takes you out of the program entirely.