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.
Sorry, I made some mistakes.
Acceptable?
This comment is hidden because it contains spoiler information about the solution
Most Pythonic solution. Simple, clean, clear, obvious.
This is my first attempt at writing a Kata!
Q1. How do I separate out the SQL-specific details into the SQL box, and insert Python specific details (ie return a list of dictionaries).
Disagree - surely 8byu are about core (basic) functionality? Those things are important, sure, but not for beginners. I send students here who have only been doing Python a few weeks. The sign-up problem is 'someone forgot the return keyword'. My guys can do that. They can (just about) do this with if / returns. But they shouldn't be trying to handle intentionally broken inputs at this early stage.
This gives a false positive if name has R or r ANYWHERE in it. Question says only first letter should be checked.
The line
name.lower()
does nothing
0 % 0 evaluates to 0, so the first condition is unnecessary.
Yes, it does need at least some of those things, if you're a LEARNER.
This is a 'clever' problem that has a fun solution, but that's not immediately apparent. 8kyu problems are, I believe, supposed to be for noobs learning their craft. Think back to how difficult it was when 'for / if / str() / etc' were new to you. 8kyu problems should be tightly defined, easily understood practice tasks that highlight some focussed aspect of coding in an approachable way. And there are loads of great 8kyu that fit that description.
This isn't one of them.
I agree, it's fun - but it's not 8kyu
This is not an 8kyu question.
A couple of my students tried it this morning, they're pretty green, but that's what 8kyu questions are for, right? The first part (add digits & subtract from number) is a 8kyu. Basic string/int casting. They worked on it for two hours and gave up in frustration, after tackling obstacle after obstacle. They've done maybe half a dozen 8kyu before but this was far beyond their ability. This morning's session might well be the end of their coding journey.
This question requires:
string / int conversion (8kyu)
chopping up a chunk of text into a dict (7kyu at least)
recursion (unless you really think about it) (6kyu)
spotting that the whole thing can be solved using modulo maths. Which most people are unlikely to have studied.
I recommend this question be regraded - and seriously hope my students don't give up on coding because of it.
More test cases?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Aha! I'm working in Python! I tried switching to JS and Ruby and see they have lots of tests! The Python version on has two.
I have now copied the tests from JS to my Python so I can hopefully see a way forward :)
Loading more items...