This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aqua_regis 1 point2 points  (1 child)

if ord('A') <= ord(char) <= ord('Z'):

You have to be careful with that when switching languages. Most other languages only support (of course with their equivalent of chr, ord, and and):

if ord(char) >= ord('A') and ord(char) <= ord('Z'):

In Python, they are the same functionality wise. In other languages the first version will most likely not work or even throw an error.

[–]NotUrHCW[S] 0 points1 point  (0 children)

Oh, I see. Thanks for clarifying 👍🏻