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.
https://stackoverflow.com/questions/51940104/python-for-i-in-range2-2-printi-what-does-i-variable-contain-it-doesnt-co
i think this website explain it
I also was stumped by this, but understand now. Range returns a sequence between two numbers, so if there is no step/sequence between the two numbers, then there is subsequent number to return. Therefore, only one value is returned.
I got it - thanks :)
I tested the code - I see that it is working. As I understand, range returns a sequence of numbers, so in the case a = 3 and b = 3 this function should give you the sequence 3 to 4 (min(a,b) = 3 and max(a,b) + 1 = 4) - so sum would be 7, not 3.
Do you know how
range
works? Do you know you can copy the code and test it yourself, on your computer or even here by clickingfork
below any solution?Can someone explain, why this is also working for the case, when a and b are the same? I see that the code is working, but I don't get it.
Your code is wrong, it doesn't return
"hello world!"
. It just returns the string passed to it. Not a kata issue. Please read this: https://docs.codewars.com/training/troubleshooting/Python Issue: The Attempt does not work although my Test was successfull.
I had to add the "hello world!" to the function in the test - is there something missing when executing the Attempt?