python take two integer arguments from a tuple -
this part of question. has error missing 1 required positional argument 'mm' when running it. know problem run time_to_minutes((h,mm),) can make run time_to_minutes(h,mm)?
def time_to_minutes(h,mm): time = h*60 + mm return time def extract_time(time): h=int(time[:-3]) mm=int(time[-2:]) return h,mm def time_between(a,b): first = time_to_minutes(extract_time(a)) return first
use star (*
) operator unpack tuple:
first = time_to_minutes(*extract_time(a))
Comments
Post a Comment