Skip to content

Instantly share code, notes, and snippets.

@AnisahTiaraPratiwi
Created March 20, 2021 10:13
Show Gist options
  • Save AnisahTiaraPratiwi/378137dd55e477284b502e4a52d78df6 to your computer and use it in GitHub Desktop.
Save AnisahTiaraPratiwi/378137dd55e477284b502e4a52d78df6 to your computer and use it in GitHub Desktop.
Flesh out the body of the print_seconds function so that it prints the total amount of seconds given the hours, minutes, and seconds function parameters. Remember that there are 3600 seconds in an hour and 60 seconds in a minute.
def print_seconds(hours, minutes, seconds):
print(3600*hours+60*minutes+seconds)
print_seconds(1,2,3)
@Napalm275
Copy link

ty!

@Himanshu-maxx
Copy link

Thnx! It helped a lot......

@Rabindra2022
Copy link

Thanks a lot

@dr-sandeep-kumar-mehra
Copy link

Thanks for the answer. Your answers are really helpful.

@LizKollie
Copy link

How did you get here? I've been stuck for like two hours -_-

@B-Litljon
Copy link

did anyone understand what the question was even asking because thats where I got stuck lol

@TerrianaO
Copy link

Can you or anyone explain the WHY as to how this works, in order to understand. This is still really confusing

@TerrianaO
Copy link

did anyone understand what the question was even asking because thats where I got stuck lol

same

@toodeeptwo
Copy link

The answer is in the print call: “print_secounds(1,2,3)” when you run it displays 3723

That is because “1” is the number of hours, “2” stands for the number of minutes and “3” is for the seconds

so when you flesh the body as Print(3600hours) you’re saying 3600 times “1” and when you add 60minutes yours saying the minutes times “2” and lastly the seconds times “3”

basically (3600x1) +(60x2) +(1x3) =3723

Hope I didn’t confuse you more than before lol I’m new too so I suck at explaining.

@ju05
Copy link

ju05 commented Jun 7, 2022

Someone else got stuck because thought that we had to give the number of seconds in an hour, then in 2 minutes, and then in 3 seconds?
The question is saying to give the TOTAL amount of seconds... LOL

@Arij551
Copy link

Arij551 commented Jun 16, 2022

thank you so much understood a lot.

@GAURAV5925
Copy link

Thanks!

@dnacoding01
Copy link

It was about the space!!!!! Man that got me.

@ashishalf
Copy link

thanks

@yassinemoutiaa
Copy link

tnx

@Demetrio26
Copy link

def print _seconds (hours, minutes, seconds):
total_seconds= hours3600+minutes60+seconds
print(total_seconds)

print(1,2,3)

Copy link

ghost commented Sep 13, 2022

ty!

hey could you help me out i a query
how does this example works:
hours: seconds//3600

@PreciousEddy
Copy link

Hey there.

I guess it was just simple English.... I made such mistake too

TOTAL AMOUNT= addition

lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment