15
MackM
2 9 24
978/ 1195
Last seen 9 years ago
Member for 9 years, 11 months, 10 days
Difficulty Normal
Best reviews / Newest reviews
TrueUntilProvenFalse-GregorySoter
Just out of curiosity, is there any reason to use while loops instead of for loops? More
SecretMessage-vikaspace 1
Nice code, I like comparing the lower-case string to the original to find capitals. I have a few suggestions though. - The input is already a string, line 2 is not needed. - The try/except blocks will only ever catch an IndexError if len(texte)==0. You can avoid this by using a for loop instead More
Indexcept-veky 2
Is there an advantage to using a try/except block instead of checking the array length? More
First-magdre 1
If you want to be a little more concise, you can unpack the date arguments directly into the datetime function with a '*'. datetime.datetime(*d1) == datetime.datetime(d1[0],d1[1],d1[2]) More
Second. Simplified realisation-vinc 1
I hadn't realized you could alter a list with .extend() while iterating through it with a for loop, that's good to know. Thank you. More
via recurssion-pax0r
Very cool solution. If you wanted to be a little more concise, you don't need to pass the current total (curr) down the recursive chain and then back up, you can get away with passing the running total back up only. For instance, def partial(data): if data: return dat More
_-blaxmi
I wouldn't have thought to lookup digit values like that, nice one. More
First-contrebasse
Nice comments, very clear code :-) More
First-Tsutomu-KKE
A very concise and readable solution, I like it. More
First-hawaiix
I like how you handle removing an element from the front of the queue. More
First-the0d
Hello, If you wanted, lines 15 and 16 could be rewritten as just return False which I find to be more clear. Up to you though :-). It is an interesting idea to keep a running count of how many more brackets have been opened than closed as well as a stack, but I think it is not neede More
monkey-typing --> s7even-s7even 1
I hadn't thought of putting an int in the list instead of the word itself, thank you for the education :-) More
First-MackM 1
I misunderstood the task. line #3 is Unnecessary and also makes my function break on inputs such as count_words("AB CAB",{'abc'}) More
First-ciel
Very concise but clear, I like it. More
symetries-toufalk
Good comments, I (think I) understand how this was done :-). More
Triangle Wave-gyahun_dash 1
Excellent code, and excellent explanation. Thank you for taking the time to share. More
First-yttamer
Nice, clear code. Just a note though, it's considered bas practice to use a built in function as a variable name (min for minutes is already used for the minimum function). More
First-Shtucer
Good comment, very clear code :-). More
First-autumnm1981
I haven't seen many solutions that move a week at a time, nice job. More
First-jjfPCSI1
Very nice! If you wanted to shorten the code however, if cmd[1] == "O": try: somme += int(stack.pop()) except: pass Can be: if cmd[1] == 'O' and stack: somme += int(stack.pop()) More
1
2 3