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.
But you're only importing, right? I mean, you aren't returning anything nor receiving the arguments... Can you explain bit more, please?
I'm just writing back now. What kind of trick is this?
interesting
adamb123, can you explain why?
Even though I took this approach, I wouldn't count it as a best practice. It sacrifices some time complexity for readability.
Mathematically, it the same, but sometimes, we lose sense with over-refactoring.
contains is the function for "in" operator. When we import it as "include", that does the trick.
how does this even work?
really "Best Practices"
Yes, the function even_or_odd returns the string "Even" if the input n is even and "Odd" if the input n is odd
what do yall think? :D
alright i'm sorry
Hi Sara,
I would suggest you to try to run the code. The module operator (%) return the reminder in the division between the first and the second number. 6 divided by 2 is 3 with 0 as remainder, so in this code would be select the first item in the tuple, "Even", that is correct. Your version is easier to understand and more suitable for python, but the code written by graf_da still works.
if i enter "6", your code will throw KeyError because 6 % 2 == 2. so i'd rather do
omg
Loading more items...