Jan. 15, 2015, 5:59 p.m. |
+ 1 |
for Comment
DiZ: You're right, it would be better but mission creator decided to use a list, that's all.
|
Jan. 15, 2015, 5:59 p.m. |
+ 1 |
for Comment
bukebuer: It should be sumList.append(array[a]) rather than sumList.append(a) The latter one only calculates t...
|
Jan. 15, 2015, 5:59 p.m. |
+ 1 |
for Comment
OMFGNuts: Yeah, kinda wrong. You actually don't need any other libraries(math) other than built-in. Also, plea...
|
Jan. 15, 2015, 5:59 p.m. |
+ 1 |
for Comment
DiZ: Maybe you can look at your previous thread when someone already replied to your question... http://w...
|
Jan. 13, 2015, 5:28 a.m. |
+ 1 |
for Comment
Sim0000: You can do like followings. def f(*args): n = len(args) # n is the number of arguments # any code
|
Jan. 7, 2015, 6:07 p.m. |
+ 1 |
for Comment
veky: I appreciate your comment, though probably it will be moderated because of some inappropriate words....
|
Jan. 5, 2015, 5:26 p.m. |
+ 1 |
for Comment
suic: Hi, there are at least two issues: 1. Your code has to be __in__ _checkio_ function as it is called ...
|
Jan. 3, 2015, 12:21 p.m. |
+ 1 |
for Comment
veky: text is really not defined. :-) It is a parameter of find_message, but that means it exists only in ...
|
Jan. 2, 2015, 6:19 a.m. |
+ 1 |
for Comment
sliziky: I figured it out- if j==k: continue if k.endswith(j) or j.endswith(k): return True return False
|
Jan. 2, 2015, 6:19 a.m. |
+ 1 |
for Comment
suic: You have to _return_ the result and not print.
|
Jan. 2, 2015, 6:19 a.m. |
+ 1 |
for Comment
suic: 1. You have to _return_ the result. Your function is currently return None. 2. array[len(array)] thr...
|
Dec. 31, 2014, 5:19 a.m. |
+ 1 |
for Comment
PriyankaGandhi: I solved it ..added the condition i.isalpha() Thanks.
|
Dec. 31, 2014, 5:19 a.m. |
+ 1 |
for Comment
bukebuer: def index_power(array, n): if n == 0: return 1 elif n >= len(array): return -1 else: return array[n]...
|
Dec. 25, 2014, 5:09 a.m. |
+ 1 |
for Comment
DiZ: Because hour hand moves along with minute hand. Look at _your_ code in line 8: angle=abs(360.0/12.0 ...
|
Dec. 25, 2014, 5:09 a.m. |
+ 1 |
for Comment
DiZ: In one hour, hour hand travels 360/12 = 30°. In one minute, hour hand travels 360/12/60 = 0.5° but m...
|
Dec. 15, 2014, 11:07 p.m. |
+ 1 |
for Comment
gyahun_dash: ### Example: ((0, 0, 1, 0, 0), (0, 1, 1, 1, 0), (1, 1, 1, 1, 1), (0, 1, 1, 1, 0), (0, 0, 1, 0, 0)) F...
|
Dec. 15, 2014, 8:03 a.m. |
+ 1 |
for Comment
DiZ: _Friends (({"a", "b"}, {"b", "c"}, {"c", "a"}, {"a", "c"})_ and _Friends ([{"1", "2"}, {"3", "1"}])_...
|
Dec. 15, 2014, 3:34 a.m. |
+ 1 |
for Comment
gyahun_dash: length = max(map(len, strings)) if strings else 0 In Python 3.4, we can write: length = max(map(len,...
|
Dec. 13, 2014, 6:39 a.m. |
+ 1 |
for Comment
Eldin: I don't know if I really forgot that or you're just magic, but thanks :D
|
Dec. 12, 2014, 11:51 a.m. |
+ 1 |
for Comment
Cjkjvfnby: > I prefer OPs solution as it is a bit more readable. Can you give a link?
|
Dec. 10, 2014, 6:07 a.m. |
+ 1 |
for Comment
veky: And if you listen to Zed Shaw, be prepared that I always answer his pointless challenge > "When all ...
|
Dec. 2, 2014, 8:26 a.m. |
+ 1 |
for Comment
Eldin: On line 16 (and 21, 29, 34, 43 and 48) you're making a variable assignment (setting count1 to 0) ins...
|
Dec. 2, 2014, 8:16 a.m. |
+ 1 |
for Comment
NerdAlert1101: My bad, I didn't iterate a range, I was instead iterating over the array elements themselves. Once t...
|
Dec. 2, 2014, 5:34 a.m. |
+ 1 |
for Comment
P1O1E: Got it sorted - changed my approach!
|
Nov. 30, 2014, 5:54 a.m. |
+ 1 |
for Comment
chrismartin: The instructions read "If N is outside the array, then return -1". As a simple way to deal with this...
|
Nov. 30, 2014, 5:54 a.m. |
+ 1 |
for Comment
DillonKo: Well, I does help a little but I tried that idea and I'm still missing something. I hate not knowing...
|
Nov. 30, 2014, 5:54 a.m. |
+ 1 |
for Comment
DillonKo: I Understand what you mean but I am still getting the same error. I agree 100%. It just doesn't seem...
|
Nov. 30, 2014, 5:54 a.m. |
+ 1 |
for Comment
chrismartin: I think you're getting an "index out of range" error because you're trying to retrieve an array elem...
|
Nov. 30, 2014, 5:52 a.m. |
+ 1 |
for Comment
Sim0000: At first, you need to convert text to lower case before line 2. Second, you need to sort frequencies...
|
Nov. 30, 2014, 5:52 a.m. |
+ 1 |
for Comment
Sim0000: In line 15, indent of 'return sum' is wrong. Current indentation means your code process only one co...
|
Nov. 29, 2014, 7:06 a.m. |
+ 1 |
for Comment
Sim0000: At least, there are if-else error. In line 7, if -> elif. In line 10, if -> elif.
|
Nov. 29, 2014, 7:05 a.m. |
+ 1 |
for Comment
DillonKo: the probmlem is that you are saying for each part return true or false. the Idea is good but you are...
|
Nov. 29, 2014, 7:05 a.m. |
+ 1 |
for Comment
Sim0000: You need to return the result. return result
|
Nov. 29, 2014, 7:05 a.m. |
+ 1 |
for Comment
Sim0000: Your code is, first check the count, then check the item. This order is a problem. In your code, the...
|
Nov. 23, 2014, 8:26 a.m. |
+ 1 |
for Comment
spoty: OK, the problem is with how index() is working. > **list.index(x)**: Return the index in the list of...
|
Nov. 23, 2014, 5:52 a.m. |
+ 1 |
for Comment
SleepyHarry: There's a slight bug with this I believe, which occurs when the point we're testing is outside the p...
|
Nov. 22, 2014, 7:32 a.m. |
+ 1 |
for Comment
veky: Instead of (polygon[0],), bunny should have written polygon[:1]. Easier, less ugly (1-tuples really ...
|
Nov. 20, 2014, 8:41 p.m. |
+ 1 |
for Comment
viktor.pecheniuk: the same :) return ','.join(sorted(list(set(first.split(',')).intersection(second.split(',')))))
|
Nov. 20, 2014, 5:39 a.m. |
+ 1 |
for Comment
alexander.chzhen: It is the perfect reason to reread "already known" documentation once again.
|
Nov. 19, 2014, 8:55 a.m. |
+ 1 |
for Comment
veky: Yes, if points are really needed for opening other areas, I completely understand people whose curio...
|
Nov. 19, 2014, 6:57 a.m. |
+ 1 |
for Comment
DillonKo: The way your code is it looks like you are searching for a median or middle number. You need to only...
|
Nov. 19, 2014, 6:57 a.m. |
+ 1 |
for Comment
bukebuer: Check this: def checkio(data): data.sort() if len(data)%2 == 0: median = (data[len(data)/2] + data[l...
|
Nov. 18, 2014, 6:03 a.m. |
+ 1 |
for Comment
Lolka_046a8a01a2de4b048779ff9f: However, most which live under "Creative" are best candidates for "Scary" :-)
|
Nov. 16, 2014, 8:03 a.m. |
+ 1 |
for Comment
blabaster: A median is a numerical value separating the upper half of a **sorted** array >>> sorted([3, 1, 2, 5...
|
Nov. 16, 2014, 6:45 a.m. |
+ 1 |
for Comment
bunnychai: line 8-9 went wrong * should not return if ONE of the friend does not find a new friend * should ONL...
|
Nov. 15, 2014, 6:44 a.m. |
+ 1 |
for Comment
Sim0000: When same number appear in array twice, your code miss. Because array.index(i) returns first index. ...
|
Nov. 15, 2014, 6:21 a.m. |
+ 1 |
for Comment
blabaster: d.keys() and d.values() are generators, so you can't sort them. If you need sorted keys, keys = sort...
|
Nov. 13, 2014, 6:01 a.m. |
+ 1 |
for Comment
yoichi: In the example of connected(name): >>> f = Friends(({"a", "b"}, {"b", "c"}, {"c", "a"}) ... >>> f.re...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
veky: Well, of course I checked it out when I read your previous post. But thanks for the link anyway. :-)...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
hanpari: There are a lot of challenge in 3d world. Do you think you can do in python retopology tool to subst...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
veky: I think you don't realize how technical this video is, and completely nonunderstandable to someone w...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
hanpari: Sorry, about that. I was playing with this stuff for too long. You can see this picture: http://blen...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
veky: Ok, now I understand the problem, but of course I have no idea how to go about solving it. :-) But f...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
hanpari: I like your observation about needed time. All retopology tool are working rather fast and this is w...
|
Nov. 12, 2014, 12:39 p.m. |
+ 1 |
for Comment
veky: By "ordinary gradient variation" I just meant a horribly naive algorithm, like: fix maxgradvar and m...
|
Nov. 12, 2014, 12:37 p.m. |
+ 1 |
for Comment
oduvan: Why do you think so? This is what I see as a user who didn't solve the mission
|
Nov. 12, 2014, 12:15 p.m. |
+ 1 |
for Comment
veky: First, you're level 6. And you're asking questions in a naive way. Don't mean to offend you, but unt...
|
Nov. 11, 2014, 2:18 p.m. |
+ 1 |
for Comment
hanpari: As expected! Judging from your reply I suppose you use your brain. I told you not to use such thing ...
|
Nov. 11, 2014, 10:49 a.m. |
+ 1 |
for Comment
hanpari: What about game? Blender Game Engine really improved. But physical simulation are impressive as well...
|
Nov. 11, 2014, 6:25 a.m. |
+ 1 |
for Comment
bukebuer: Text should be in all lowercase when matching words. So change this: if i in text.lower():
|
Nov. 7, 2014, 7:53 a.m. |
+ 1 |
for Comment
Cjkjvfnby: > Again, I don't think it matters here. Checkio is out of real programming word. It is single person...
|
Nov. 7, 2014, 7:53 a.m. |
+ 1 |
for Comment
maurice.makaay: When you like putting functions that are only used together in a single function, boy.., you must qu...
|
Nov. 7, 2014, 7:53 a.m. |
+ 1 |
for Comment
Cjkjvfnby: > When you like putting functions that are only used together in a single function, boy.., you must ...
|
Nov. 6, 2014, 12:26 p.m. |
+ 1 |
for Comment
DiZ: I tested this solution, 100% success on 10000 random tests (right hand rule is very useful)! But it ...
|
Nov. 4, 2014, 11:57 a.m. |
+ 1 |
for Comment
maurice.makaay: Nice shortcut in the end, to use (res > 180). It doesn't make that last line extremely clear, but it...
|
Nov. 4, 2014, 7:28 a.m. |
+ 1 |
for Comment
hanpari: This video might change your opinion :) https://www.youtube.com/watch?v=o9pEzgHorH0
|
Nov. 3, 2014, 8:41 a.m. |
+ 1 |
for Comment
veky: You can think whatever you want, but I think you're subtly wrong. Does one Geoffrey Hill, for exampl...
|
Nov. 3, 2014, 8:41 a.m. |
+ 1 |
for Comment
maurice.makaay: So you consider yourself a code poet. Noted! :)
|
Nov. 3, 2014, 8:41 a.m. |
+ 1 |
for Comment
maurice.makaay: I don't think unclear code can be caused by the use of imports (but I see that dirk86 already agreed...
|
Nov. 3, 2014, 6:11 a.m. |
+ 1 |
for Comment
bukebuer: try this: if word[i].isalpha() and word[i+1].isalpha(): word[i].isalpha returns a function object wh...
|
Nov. 1, 2014, 7:57 a.m. |
+ 1 |
for Comment
N1FFO: Technically, this is two lines: The def line and the return line. You can get it down to one actual ...
|
Oct. 31, 2014, 7:18 p.m. |
+ 1 |
for Comment
blabaster: The template of solution was def checkio(number): ... return result You write something like def che...
|
Oct. 30, 2014, 4:47 a.m. |
+ 1 |
for Comment
Cjkjvfnby: Can you point some documentation link, for your expectation?
|
Oct. 30, 2014, 4:47 a.m. |
+ 1 |
for Comment
DiEvAl_0d0e0434e59e45f68684d0e: Not a bug. https://docs.python.org/2/library/functions.html#round
|
Oct. 28, 2014, 6:21 a.m. |
+ 1 |
for Comment
Cjkjvfnby: Do you know how I gues that you are russian? Use CTRL+F to find you "c".
|
Oct. 23, 2014, 5:04 a.m. |
+ 1 |
for Comment
Sim0000: Your subscript is reversed. In line 23, grid[n2][n1]. In line 26, grid[row][col].
|
Oct. 20, 2014, 8:34 a.m. |
+ 1 |
for Comment
vinc: I think it's overhead. 2d is clearer. "Flat is better than nested."
|
Oct. 19, 2014, 4:05 a.m. |
+ 1 |
for Comment
spoty: Your solution?
|
Oct. 17, 2014, 3:44 a.m. |
+ 1 |
for Comment
MagiMaster: For example 1, you have a four space board and you roll a four-sided die. So if you roll a 1 or 2, y...
|
Oct. 17, 2014, 3:17 a.m. |
+ 1 |
for Comment
zver1zver2: good code
|
Oct. 17, 2014, 3:17 a.m. |
+ 1 |
for Comment
UndeadMonkey: Very clear and succinct; I like it!
|
Oct. 16, 2014, 4:38 a.m. |
+ 1 |
for Comment
nathan.l.cook: That's my point. I'm still very new, and easily distracted. :) My first inclination when confronted ...
|
Oct. 16, 2014, 4:21 a.m. |
+ 1 |
for Comment
Sim0000: Because, there is another punctuation '?'.
|
Oct. 16, 2014, 3:08 a.m. |
+ 1 |
for Comment
Sim0000: At least, you need () after isalpha.
|
Oct. 15, 2014, 1 p.m. |
+ 1 |
for Comment
Sim0000: You can use set union to get transitive law. In your case, when users['scout2'] = {'scout1'} users['...
|
Oct. 15, 2014, 1 p.m. |
+ 1 |
for Comment
Sim0000: Your code ignore indirect relation. In first example, scout1 and scout2 are related, and scout3 and ...
|
Oct. 14, 2014, 5:57 a.m. |
+ 1 |
for Comment
blabaster: Your code global hasher # determine x and y position fix it: global hasher hasher = 0 # determine x ...
|
Oct. 14, 2014, 5:57 a.m. |
+ 1 |
for Comment
bunnychai: what if setting the hasher to 0 after line 49?
|
Oct. 13, 2014, 7:10 a.m. |
+ 1 |
for Comment
oduvan: Hi :) I think using "return" as a variable wasn't a great idea. The condition at line 12 doesn't mak...
|
Oct. 13, 2014, 7:09 a.m. |
+ 1 |
for Comment
oduvan: Hi :) You can try to put print(i) after line 14 to see what is inside.
|
Oct. 11, 2014, 10:01 a.m. |
+ 1 |
for Comment
veky: 'print "hello world"' is cool, the only problem is it isn't written in Python. :-P Of course I'm bia...
|
Oct. 9, 2014, 4:08 a.m. |
+ 1 |
for Comment
bunnychai: 4/3 * math.pi * ...
|
Oct. 9, 2014, 4:08 a.m. |
+ 1 |
for Comment
bunnychai: input is a 3-tuple, could just feed in date() by date(*date1), where date is the datetime.date...
|
Oct. 8, 2014, 3:54 a.m. |
+ 1 |
for Comment
bukebuer: It should be "for i in data:" instead of "for i in range(len(data)):". The latter one will just gene...
|
Oct. 7, 2014, 6:51 a.m. |
+ 1 |
for Comment
veky: ## Helpful Tips: Python Bad Practices Funny. He fusses about nonidiomatic Python, but he does the sa...
|
Oct. 6, 2014, 3:24 a.m. |
+ 1 |
for Comment
spoty: I have run your code and didn't get any error. This task just: "The Flat Dictionary" task doesn't ac...
|
Oct. 5, 2014, 2:32 a.m. |
+ 1 |
for Comment
Sim0000: In line 4, range(0, len(array), 2) is correct. In line 5, you need to add array[i] instead of i. And...
|
Oct. 5, 2014, 2:32 a.m. |
+ 1 |
for Comment
spoty: 1.hint: elif 2.hint: check your indentation 3.hint: & is not and
|
Oct. 5, 2014, 2:31 a.m. |
+ 1 |
for Comment
oduvan: Hi Terry. We are glad to have you here. I hope you enjoy the game
|
Oct. 4, 2014, 2:56 p.m. |
+ 1 |
for Comment
spoty: Because your regex is not correct: check this out: https://www.debuggex.com/r/7cDLoKbRwxJlymCS
|