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.
I feel like an idiot for asking this but why is it ndx +1 for range instead of just ndx?
No chromosome is written like this, X comes first then Y.
Nice!
Well done! Very useful functions on
string
The answer is to divide by 2, if the remainder is 1, then it is odd, and if the remainder is 0, it is even
It's too coooool!
da best
I don't even get this solution but I'm new to this. How do we decide which are odd-numbers and which are even?
This comment is hidden because it contains spoiler information about the solution
What I did
if the condition to check will be "YX" , i think this solution wouldnt work ..
Traceback (most recent call last):
File "/workspace/default/.venv/lib/python3.10/site-packages/codewars_test/test_framework.py", line 112, in wrapper
func()
File "/workspace/default/tests.py", line 8, in basic_tests
test.assert_equals(chromosome_check('YX'), 'Congratulations! You're going to have a son.')
File "/workspace/default/solution.py", line 4, in chromosome_check
return "Congratulations! You're going to have a {}.".format(gender[sperm])
KeyError: 'YX'
Please check https://www.codewars.com/kata/reviews/56efabc004d4fd59b2000062/groups/62c3cf384b47570001757892
Wow I didn't think of that
Nice! Wish I thought of that :D
Got the same solution xD
Loading more items...