Thursday, 20 March 2014

Abi's code finished

def main():
    best=0
    worst=100
    total=0
    count=1
    while count<4:
        swimtime=int(input("How fast is your swim time?"))
        if swimtime>best:
            best=swimtime
        elif swimtime<worst:
            worst=swimtime
        total=total+swimtime
        print(best, worst)
        count=count+1
    print(best, worst)
    print("The average is ",total/count)

1 comment:

  1. Well done - similar to cars..
    Is your question nearly ready?
    Mr C

    ReplyDelete