5 Replies - 397 Views - Last Post: 02 October 2017 - 11:59 PM Rate Topic: -----

#1 slooth  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-September 17

Newbie Coder need quick help

Posted 21 September 2017 - 10:56 AM

So I just started an a level computer science course and lets just say it's been difficult considering I haven't had any experience. Got stuck on this question I had to do so need some help. Had to ask for an amount of seconds to be converted into hours,minutes and seconds. This is what I have so far:

sec = int(input("Input your number of seconds: "))
s = sec % 60
h = sec//3600
m = sec%3600//60
print(" hours" h, " minutes" m, " seconds" s,)



might just be my terrible maths thats made me go wrong somewhere heyho

This post has been edited by ndc85430: 03 October 2017 - 09:34 PM
Reason for edit:: Added code tags.


Is This A Good Question/Topic? 0
  • +

Replies To: Newbie Coder need quick help

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13489
  • View blog
  • Posts: 53,885
  • Joined: 12-June 08

Re: Newbie Coder need quick help

Posted 21 September 2017 - 11:04 AM

What's the issue?
Was This Post Helpful? 0
  • +
  • -

#3 DK3250  Icon User is offline

  • Pythonian
  • member icon

Reputation: 320
  • View blog
  • Posts: 1,055
  • Joined: 27-December 13

Re: Newbie Coder need quick help

Posted 21 September 2017 - 11:24 AM

Apart from three missing comma in the print statement, I don't see any problem.
Was This Post Helpful? 1
  • +
  • -

#4 slooth  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-September 17

Re: Newbie Coder need quick help

Posted 21 September 2017 - 11:46 AM

View Postmodi123_1, on 21 September 2017 - 11:04 AM, said:

What's the issue?


when i try to run it, it comes up with syntax error highlighting the h in the print statement

View PostDK3250, on 21 September 2017 - 11:24 AM, said:

Apart from three missing comma in the print statement, I don't see any problem.


well I added commas and it works so i learnt something new today
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13489
  • View blog
  • Posts: 53,885
  • Joined: 12-June 08

Re: Newbie Coder need quick help

Posted 21 September 2017 - 11:51 AM

.. and knowing is half the battle!
Was This Post Helpful? 0
  • +
  • -

#6 albert003  Icon User is offline

  • D.I.C Regular

Reputation: 14
  • View blog
  • Posts: 367
  • Joined: 15-December 14

Re: Newbie Coder need quick help

Posted 02 October 2017 - 11:59 PM

modi123_1 GI Joe!!!!

Ok, so take a look at the print statement. What do you see that could be causing the problem?. Go back to your notes from class or the book you're using and see what the problem could be.

This post has been edited by albert003: 02 October 2017 - 11:59 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1