We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5d89d0 commit e87d09fCopy full SHA for e87d09f
lap_time_counter.py
@@ -0,0 +1,21 @@
1
+# Starting Out with Python (4th Edition).
2
+# Tony Gaddis.
3
+# Page 225.
4
+# Programming Exercise.
5
+# Q 3. Lap Times.
6
+
7
+round_count = int(input("Enter the number of rounds: ")) # number of times run around racetrack.
8
+time = 0 # timer at initial state.
9
+time_array = []
10
11
+for timer in range(round_count):
12
+ lap_time = float(input("Enter Lap Time: t = "))
13
+ time_array.append(lap_time)
14
+ time += lap_time
15
16
+average_time = time/round_count
17
+fastest_time = max(time_array)
18
+slowest_time = min(time_array)
19
+print("Fastest Lap Time: ", fastest_time)
20
+print("Slowest Lap Time: ", slowest_time)
21
+print("Average Lap Time: ", average_time)
0 commit comments