10
Last seen 4 years ago
Member for 8 years, 7 months, 5 days
Difficulty Normal
Over complicated a bit. I think you do not need that much returns here, just have 1 return and change your data in if-else conditions.
More
well am_or_pm took me a sec to think.
nice formatting with minutes, but there is no need to convert mins into int.
More
There is a nice way to assign elements from the collection.
c = [1, 2]
a, b = c
Using this we can write following.
time = "01:23"
hours, mins = time.split(':') # <- ["01", "23"]
Moreover, we can use function int() on every element of array with the help of map().
hours, m
More
over complicated a bit
you can make just 1 check for 'a.m.' or 'p.m.'
after that there are 2 cases for checks: if 12 == 0 and if 12 > 0
More
Defining lambdas is not recommended. Pep will say to use def.
Btw cool solution idea.
More
Seems a little bit complicated.
We know that 1 hour == 60 mins == 15 degrees. (according to first assert)
=> 1 min is 15/60 = 0.25 degrees.
What do you think about following formula?
(H - 6) * 15 + M * 0.25
More
The point of inheritance is that class Knight uses all defined parameters in class Warrior.
That means that there is no point in writing the same thing one more time. I mean you defined health=50 and is_alive=True in class Knight but they are already defined in class Warrior.
More