Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Normally to "go to the next one" that's what
while
loop condition if for, but doing it withbreak
keyword is fine too. And yep,break
's only use in python is to break out of loop.I agree. Also you could move the dict outside the function, so the dict wouldn't be created every function call.
Yay, code golf. I like how on CodeWars there are always some random code golf solutions too.
Is it even possible for
calendar
module to be unavailable?Imagine you had to choose which solution you prefer to debug. Good luck debugging that 3 liner.
Also, I can write shitty code and rank up as long as solutions I post work.
Lastly, what is the point replying to a 2 year old comment and ranting about how wrong I was as a beginner?
Ah yes, the new 54421 character line length convention
you can store keys of a dict as integers like so:
Python translation has an error in the tests:
ModuleNotFoundError: No module named 'codewars_test'
expected result: https://pastebin.com/4YnzQzkV
naked_twins
lolIn the python tests first test in "fixed tests" is "x" with expected output is "x". "x" doesn't look like a number to me.
In the python translation, function names in description don't match with those expected in code. For example: in code:
max_pn
, in description:maxp
.By the way, It's a great idea to prompt people to split the problem into several subproblems/functions (just like this kata does). Good work g964!
please tell me it is generated
the function is creating dict on the fly.
get
method of dictionary works like bracket notation i.edict_name[key]
except it returnsNone
instead throwing exception if passed key doesn't exist in the dict.No need for break statements here, they won't be executed anyway
Loading more items...