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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -