On Fri, Feb 17, 2012 at 3:16 AM, alain Delon wrote:
> userName = raw_input("Enter your name ")
> print "hi " + userName + ". \n "
> seconds = input("Enter the number of seconds since midnight:")
> hours = seconds/3600
> hoursRemain = hours%60
**
On 17/02/12 01:29, Daryl V wrote:
def Int2Digit(integer):
if integer < 9:
strInteger = "0"+str(integer)
else:
strInteger = str(integer)
return strInteger
Or using format strings:
def int2Digit(integer):
return "%02d" % integer
Although this doesn't beha
You've gotten some really excellent advice about how to approach working
with the time format. Here's a chunk of code I use quite a bit. It's
probably sub-optimal, but playing with it might help you come up with a
solution that works for your application.
def Int2Digit(integer):
if integer
On 02/16/2012 04:46 PM, alain Delon wrote:
userName = raw_input("Enter your name ")
print "hi " + userName + ". \n "
seconds = input("Enter the number of seconds since midnight:")
hours = seconds/3600
hoursRemain = hours%60
minutes = hoursReamain/60
secondsRema
Welcome to the joys of time and date handling.
: userName = raw_input("Enter your name ")
: print "hi " + userName + ". \n "
: seconds = input("Enter the number of seconds since midnight:")
: hours = seconds/3600
: hoursRemain = hours%60
: minutes = hoursReamain/60
:
>userName = raw_input("Enter your name ")
> print "hi " + userName + ". \n "
> seconds = input("Enter the number of seconds since midnight:")
> hours = seconds/3600
> hoursRemain = hours%60
> minutes = hoursReamain/60
> secondsRemain = minutes%60
> print "hours: " + "min
userName = raw_input("Enter your name ")
print "hi " + userName + ". \n "
seconds = input("Enter the number of seconds since midnight:")
hours = seconds/3600
hoursRemain = hours%60
minutes = hoursReamain/60
secondsRemain = minutes%60
print "hours: " + "minutes: "