I tried to code a clock tester*, can't see why it isn't working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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!")
:bust_in_silhouette: Reply From: exuin

What about if clock[3] == ":"?