11
yun_zynb
1 7 22
578/ 645
Last seen 3 years ago
Member for 8 years, 8 months, 19 days
Difficulty Normal
Best reviews / Newest reviews
First-Sim0000 2 1
why we need to use copy at 6th line? I tried both (use copy and not) at this question, and both are work. Could someone explain the difference? More
1 line, no str(), recursion, logical operator-yun_zynb
### note: ```python a or 1 == a if a != 0 else 1 ``` More
First-janesteps
int(a / b) == a // b a / b -> float a // b -> int More
First-Legion_Pleingaz
replace new = sorted(data) by data.sort() so that, you could not to use "new" variable More
First-Amachua
awesome! creative! good job!!! More
First-vuz3
you use ord() in order to check whether it is lower alphabetic, and maybe you could use ``` import string for c in text.lower(): if c in string.ascii_lowercase: ...... ``` More
Simulated-PositronicLlama
My code is very similiar to yours.But I use **accumulate(count(1))** instead of **count(1)**. from itertools import count, accumulate def checkio(food): for pigeon in accumulate(count(1)): if food < pigeon: return max(feeded, food) food -= pig More
First-internom
line 6~9 duration = duration // 60 + 1 if duration % 60 else duration // 60 Moreover, use **ceil** function in **math** module from math import ceil duration = ceil(duration/60) More
First-internom
line 11~14 1.use **get** method data[d] = data.get(d, 0) + duration 2.**collections.defaultdict** from collections import defaultdict as ddict data = ddict(int) # ~~~ data[d] += duration More
reduce-Cjkjvfnby
the same one line code Instead of using reduce function, I write a recursion function. ```python checkio = lambda n: (n%10 or 1)*checkio(n//10) if n else 1 ``` more explain: > ( a or 1 ) == ( a if a != 0 else 1 ) ### some question: when i solve question on ckeckio, sometimes, I don't know whethe More