8
Last seen 4 years ago
Member for 7 years, 2 months, 13 days
Difficulty Normal
\+ for adding comments!!!
You could use methods letter.[islower()](https://docs.python.org/2/library/stdtypes.html?highlight=islower#str.islower)(Your link address here…) / .isupper() / .isnumeric instead of conditions like ('a' <= letter <= 'z')
More
wow, that's a nice way to iterate over a numeric object! Thanks =)
More
I was one step to implementing the same solution when I decided that it's gonna be too complex. Then I went reading the documentation and accidentally found that the int(str_number, radix) does exactly what we need here! But with incorrect input it throws an exception, so our task was to catch it.
More
why do you check 'if "right" in i' before replace()? replace() performs this check too =)
More
Huh, that's and interesting way to form the result =) This makes your solution cool because we can replace the game's words with any other 4-letter words, and your program will work correctly
More
I was trying to create a single super-regexp but failed. The best solution I found was '[a-z].\*[A-Z].\*[0-9]' regex, but it works only if the order of chars is the same (e.g. 'aH9' but not 'Ha9')
I could use some hint here
More
oh my... this head/body/tail unpacking mechanism looks like a pure magic for me!
Learnt something new, thanks
More
btw, we have nice built-in functions to get max and min element from collection: max(args), min(args)
More
Nice. I used similar approach - find starting after first occurence. But I forgot to use second parameter of find function, and cropped the initial string. You did better here =)
More
you could place "count > 2: break" as a first check in your loop.
Why would you check anything else if you already have 3 on your counter, right? =)
More