Dick Moores wrote:
> Please give me constructive criticism of 
> <http://www.rcblue.com/Python/stopWatchForWeb14-a.py>
>   
1 - lapCounter is not used.

2 - simplify:

                if lapTimeFlag == False:
                    print "Total Time is", secsToHMS(totalTime)
                    print "StopWatch is continuing to time.."
                else:
                    currentLapTime = markTime - lapEnd
                    print "Current time of this lap, Lap %d, is %s" % (lapNum, 
secsToHMS(currentLapTime))
                    print "Total Time is", secsToHMS(totalTime)
                    print "StopWatch is continuing to time.."

    new version:

                if lapTimeFlag:
                    currentLapTime = markTime - lapEnd
                    print "Current time of this lap, Lap %d, is %s" % (lapNum, 
secsToHMS(currentLapTime))
                print "Total Time is", secsToHMS(totalTime)
                print "StopWatch is continuing to time.."



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to