188k views
2 votes
In a day, a car passes n

kilometers. How many days does it take to travel a route of length m
kilometers?

The program receives as input in the first line a natural number n
and in the second line a non-negative integer m
. Python code

User Rama Rao
by
8.5k points

1 Answer

2 votes

#Calculate days.

def calculateDay(m, n):

assert isinstance(m, int) and m >= 0, "m should be a natural number."

assert isinstance(n, int) and n > 0, "n shouldn't be negative."

return m/n

#Main function

def Main():

m, n = input().split()

print(f'Result: {calculateDay(int(m),int(n)):.2f} days.')

#Point.

if(__name__ == "__main__"):

Main()

In a day, a car passes n kilometers. How many days does it take to travel a route-example-1
User Siomara
by
8.7k points

No related questions found