Hi people of the internet. I besiege you. I’m a complete noob but wait for it, I am hooked on coding. So far I have solved a few very basic arguments and I’ve finished some of the basic tutorials on html and CSS.
I came across a question a day or 2 ago and I’m looking for insight. Basically I’m trying to create a program that a user can input a time and see if a college is open or not but on top of that I want to extend the opening hours a few hours by the program asking if a college guard is there to open the gate after closing time. This actually wasn’t in the question other than guard is a Boolean either t or f doesn’t matter
I don’t really want the question answering but I would like to be encouragingly fireman’s lifted in the right direction. Now here is a version of the code in note form. Don’t laugh. I’ve been coding for less than a week and working in Python for 2 days lol
# can i convert this into : rather than decimal point?
visit = float(input("What time would you like to visit"))
time = (7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
# can i use [:] to simplify time line?
a = visit
b = time[0]
c = time[-1]
x = (18, 19, 20)
guard = True
while a == x[0] or x[1] or x[2]:
print("Guards on duty!")
# need to somehow separate guard duty from out of hours
if a < b or a > c:
print("Out of hours")
else:
print("You're in")
Sorry it’s an incredibly long post!