17
han97
4 17 25
1606/ 1695
Khan Ag
Last seen 5 months ago
Member for 7 years, 10 months, 28 days
Difficulty Normal
Best reviews / Newest reviews
Simple shoelace formula_-fantakeshi
better use sum built-in function More
Simple shoelace formula_-fantakeshi
I used same logic. But forgot about i can extract the "1/2" out of sum :) More
First-han97
checked it with timeit, runs faster then first implementation 4 times :) input: print timeit.timeit("checkio(random.sample(xrange(10000), 1000))", number=1000, setup="from __main__ import checkio; import random"), \ timeit.timeit("checkio2(random.sample(xrange(10000), 1000))", number=1000, s More
First-thibault.dereu
not very fast, mine is faster :D Checked with timeit for 19 rings: 12.9365308285 43.1890509129 More
First-pavlo.tsiupka
It won't work if you change some of the attributes. I'm talking about self.east and self.north More
Three words-IcaroIA
It's not pythonic. Better not use counters and this kind of stuff u use in c/c++ or java. More
First-freeman_lex
instead of: while t.replace(' ', ' ') != t: t = t.replace(' ', ' ') you could use: re.sub(' +', ' ', text) More
First-BoguslawKalka
if len(args)==0: and if args: is the same, because in python all empty list, dicts etc. means False. More
First-soma115
Better use built-in "sum" function More
Simple-Gideon
Better use "join" method of strings. More
Even the last 2-Ginger03 1
Better use slicing for it. Like this: array[::2]. First two parameters are for begin and end indexes. If you want whole list, you don't touch it (for example [1,2,3][:] will retrieve the same list). Third parameter is for "step". For array=[0,1,2,3,4,5] it will retrieve [0,2,4]. More
My work-veghadam1991
Python has built-in sorted method More
First-clockkent
Better use generator instead of creating a list for loops. Because u iterating two times, first when you create list, then inside of loop. It is slower 2 times. Just change [] to () and you will not create a list, just iterate over it. More
First-Gra4
Use join method of strings to concatenate strings of iterable objects. More
1 2 3
4