@WiNDfaLLx/

igcse code draft

Python

calming electronic music: https://youtu.be/B0yES8tjCAg

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#*YEETS CODE AT YOU*

#yes this is online
#but that DOES NOt mean it's free to use
#do not steal my code please
#this is 100% written by cAndidaTe 4504, cEnTrE 10172
#I just can't afford private repls skdhfkshdj

allbusdata = [["A",[],[],[],[]],["B",[],[],[],[]],["C",[],[],[],[]],["D",[],[],[],[]],["E",[],[],[],[]],["F",[],[],[],[]]]

#look at all those square brackets
#shexy

days = ("Mon", "Tue", "Wed", "Thu", "Fri")

data = ""

counter = 0
totaller = 0
latestbus = [0, ""] #max value and letter of that route

#some people say I use too many arrays
#some people are too weak to handle this eFfIcIeNcY

for route in allbusdata:
    print("Yeeting the data for Bus into the system", route[0])
    for week in range(1, 5):
        print("this is 4 Week", week)
        for day in days:
            data = input("What's the dAta 4 " + day + str(week) + ": ") #yeeeeeeeeet
            while not (data.isdigit()):
                data = input("nOpe this is a bAd 'nUmber' dude")
            route[week].append(int(data))
#oh heck negatives don't work

#try-except conditionals are a bad idea and don't loop


print("\nNumber of times each bus route was late :(")
for route in allbusdata:
    counter = 0
    for week in range(1, 5):
        for day in route[week]:
            if day < 0:
                counter += 1
    if counter > latestbus[0]: #wow multitasking. this is for point 3
        latestbus[0] = counter
        latestbus[1] = route[0] #heck yeah
    print(counter, "late arrivals for Bus", route[0])

print("\nAverage laTeNess")
for route in allbusdata:
    totaller = 0
    for week in range(1, 5):
        for day in route[week]:
            totaller += day
    totaller = totaller / 20
    if totaller < 0:
        print((totaller * -1), "minutes late for Bus", route[0])
    else:
        print(totaller, "minutes early for Bus", route[0])

print("\nlatest bus route for day numbers", latestbus[1])

print("\nlate on just late days???")
for route in allbusdata:
    counter = 0
    totaller = 0
    for week in range(1, 5):
        for day in route[week]:
            if day < 0:
                counter += 1
                totaller -= day
    print(round(totaller/counter, 1), "minutes late on late days for Bus", route[0])

#amazing
#now for task 3

data = input("Please enter a day code:")