okay so this is my comp sci lab

*

Problem: *ProductionTime.py It takes exactly 2 minutes and 7 second to
produce an item. Unfortunately, after 143 items are produced, the fabricator
must cool off for 5 minutes and 13 seconds before it can continue. Write a
program that will calculate the amount of time required to manufacture a
given number of items.
*

Output: *Output the amount of time D days HH:MM:SS
*

Sample Input :
*

numItems =1340 Represents the numbers items to be manufactured
*

Sample Output :
*

2 days 00:03:17



this is the coding i have written for it!

numitems= int(raw_input("Enter the number of items needed to be
manufactured:"))
seconds=numitems*127
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print "%d:%02d:%02d" % (h, m, s)

but how would i add the 5 min and 13 seconds after 143 items have been
produced???
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to