Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Elayon |
*a code that checks if the clock variable is actually a clock or something else
I am a beginner programmer and I know this hurts your eyes, please also tell me how can I achieve what I’m trying to achieve in a simpler way as well
if clock.length() == 5:
for current in clock.length():
match typeof(clock[current] as int):
TYPE_STRING:
if current == 3 and clock[current] == ":":
pass
else:
print("wrong clock")
break
TYPE_INT:
pass
_:
print("wrong clock")
break
print("correct!")