Tell us what’s happening:
I have some questions about this challenge after reading the task I found it quite confusing
Do not import any Python libraries. Assume that the start times are valid times.
Does datetime count under it since it is a module and not a library?
What is it that must be inputted? input from a user? or is it a converter that converts a time since it tells us to use return and not print? must the outcome be printed? what excatly is the function of this code.
Your code so far
import datetime
start = 12 AM, 12 PM
duration = hours, minutes
week_day = mon, di
n = is the number of days later
def add_time(start, duration, week_day):
new_time = duration + start + week_day
#if the result will be the next day
if result == next_day:
print(new_time + next_day)
#if the result is more then 1 day later
elif result > next_day:
print(new_time + (n days later))
else
print(new_time)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
.
Challenge: Time Calculator
Link to the challenge: