32
Awesome Team
Mykhailo Ohorodnikov
https://ogoro.me
Last seen 1 year ago
Member for 3 years, 8 months, 29 days
Difficulty Normal
Python developer with telecom background - Kyiv, Ukraine
clear and efficient usage of datetime format directives - thank you)
More
clear and compact utilization of datetime formats, thank you!
but variable name "min" seems to shadow built-in function min..)
More
re.split to get phrase parts, no datetime imports - interesting solution, thank you!
More
thank you for the solution - clear and efficient!)
don't you know why no-one seems to use re.Scanner for this mission?
it is from Python Cookbook, looks very convenient - for example:
https://py.checkio.org/mission/hacker-language/publications/ogoro/python-3/scanner-with-code-dictionary/
)
More
you could use:
line.insert(0, line.pop())
or even deque:
https://docs.python.org/3/library/collections.html#collections.deque
with rotate:
https://docs.python.org/3/library/collections.html#collections.deque.rotate
More
interesting solution, thank you!
i also found out that new function "removeprefix" was introduced in version 3.9:
https://docs.python.org/3/library/stdtypes.html#str.removeprefix
)
More
thanks for the clear code)
you could also use comprehension:
# Loops columns and diagonals to check for wins
for index in range(5):
if checklist[index] == 'XXX':
return 'X'
elif checklist[index] == 'OOO':
return 'O'
->
if any(c == 'XXX' for c i
More
thank you for itertools.compress() and itertools.product() with repeat parameter!
More
interesting usage of hash, thank you)
does it have any advantages over usual comparison?
More
very clear solution with minimal replacements, thank you!)
how did you avoid re.error handling?
More