40
Awesome Team
Alexander Lyabah
http://www.checkio.org/user/oduvan/
Last seen 13 hours ago
Member for 13 years, 10 months, 21 days
Difficulty Easy
love it!
too many tabs. Same solution but without that many tabs:
def end_zeros(num: int) -> int:
if num == 0:
return 1
if num < 9:
return 0
x = num
y = 0
while x > 9 and x % 10 == 0:
y += 1
x
More
I think those two functions have something in common :)
Line 3: I think you don't need function list here
More
Hi :)
It is not a bad solution. But I think it will be harder for you to expand it when you need to add thousands. So would definitely take a look on other solutions from leader board.
In terms of code stylistic it is a good solutions. Some mirror issues can be fixed such as too long lines or miss
More
I like the idea here of not using the third function
http://www.checkio.org/mission/min-max/publications/samulih/python-27/first/
More
line2: if you change -1 to 1 it will work anyway. Do you know why?
More
good, except you don't need square brackets in sum. So you work with generator instead of list comprehension
More
I'm wondering.
How this solution gets so many up-votes
More
Imagine how much easier it could be to read.
enemy_mark = 'X' if your_mark == 'O' else 'O'
More
The % does two things, depending on its arguments. In this case, it acts as the modulo operator, meaning when its arguments are numbers, it divides the first by the second and returns the remainder. `34 % 10 == 4` since 34 divided by 10 is three, with a remainder of four.
More
I think having a simple marker `is_abs` can replaces lines 2 and 9 by:
is_abs = path.startswith('/')
if is_abs: return '/'
More