You need to sign in or sign up before continuing.×
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.
The end of the description of this kata says try not to use the if function, so this solution should not be voted for best practices!
In Python 3, yes. Not in Python 2. The
a/(b*1.0)
makes the code Python 2 compatible.in elif operator == "divide":
return a / (b * 1.0)
you dont need to do (b * 1.0), because the result of normal division is always a float
5 / 2 = 2.5
5 // 2 = 3