I have to make a program that asks for the "login hour" 24 times, puts all those values into a list and then outputs how many times each login hour was used and if you type -1 it breaks the loop for example with 6 inputs it would be.
Please enter login hour: 3
Please enter login hour: 4
Please enter login hour: 3
Please enter login hour: 3
Please enter login hour: 4
Please enter login hour: -1
There were 0 logins In hour 0
There were 0 logins In hour 1
There were 0 logins In hour 2
There were 3 logins In hour 3
There were 2 logins In hour 4
....till 24
This is what I have done so far. I just do not know how to count each element type and make them separate from the rest.
loginCount = 0
hour = []
for i in range(0,24):
item = int(input("please enter login hour:")
hour.append(item)
if hour[i] == -1
break
else:
loginCount = loginCount + 1