Write an application that reads values representing a time duration in hours, minutes, and seconds and then prints the equivalent total number of seconds. (For example, 1 hour, 28 minutes, and 42 seconds is equivalent to 5322 seconds.)

Answer :

Answer:

Explanation:

def cvtToSeconds(hours,minutes,seconds):

   total_seconds=3600*hours+60*minutes+seconds;

   return total_seconds

def readData():

   hours = eval(input("Enter Hours: "))

   minutes = eval(input("Enter Minutes: "))

   seconds = eval(input("Enter Seconds: "))

   total_seconds=cvtToSeconds(hours,minutes,seconds)

   print("Total Seconds: "+str(total_seconds))

readData()

${teks-lihat-gambar} dayanandghelaro

Other Questions