Skip to content

Latest commit

 

History

History
51 lines (27 loc) · 662 Bytes

Keep_Hydrated.md

File metadata and controls

51 lines (27 loc) · 662 Bytes

CodeWars Python Solutions


Keep Hydrated!

Description:

Nathan loves cycling.

Because Nathan knows it is important to stay hydrated, he drinks 0.5 litres of water per hour of cycling.

You get given the time in hours and you need to return the number of litres Nathan will drink, rounded to the smallest value.

For example:

time = 3 ----> litres = 1

time = 6.7---> litres = 3

time = 11.8--> litres = 5

Given Code

def litres(time):
    pass

Solution

def litres(time):
    return int(time * 0.5)

See on CodeWars.com