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 dont know why it is not best practice :>
Python fork
see the comments below. this solution was written in Pyrthon 2. Python 3 changed the
round()
function for halfway cases: it used to be half away from zero (0.5 --> 1
,1.5 --> 2
), now it's half towards the nearest even integer (the so-called "banker's rounding"): (0.5 --> 0
,1.5 --> 2
)Random tests in all languages should prevent solutions like this one in Python.
upgrading to
issue
approved
This comment is hidden because it contains spoiler information about the solution
Took longer than it should. Have a blessed day... NOT
This shouldn't be valid, but the test literally doesn't work in py 3
How come when I did it it was incorrect????
Which verion did you do?
This probably should be 7kyu.
6kyu usually makes me sit thinking, this was way too easy imo.
OwO
def price(a: int, b: int) -> int:
if a == 0:
t = 0
elif b == 0:
t = 0
else:
a = a + b
b = b - 0
t = a * b - b ** 2
return t
lol, i just changed the test code function name to f from fun. this is so cursed!
Approved.
Loading more items...