Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to keep track of your sport running times in python

import datetime

class BoldColors() :

    # Bold
    Black='33[1;30m'       # Black
    Red='33[1;31m' 
    

dt = datetime.datetime.today()
day = dt.day
month = dt.month
year = dt.year

yourTime = input(BoldColors.Red+"Please enter your best time : ")
yourWorstTime = input(BoldColors.Black+"Please enter your worst time : ")
with open('Times.txt', 'a') as f:
    f.writelines(f"{day}/{month}/{year}: best time {yourTime} worst time {yourWorstTime} ")
    f.writelines('

')
 
PREVIOUS NEXT
Tagged: #track #sport #running #times #python
ADD COMMENT
Topic
Name
3+4 =