(GDScript), Getting "error: ":" expected at the end of the line" When it is clearly present.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Racerrroar
func _physics_process(delta):
  angle = self.rotation_degrees
  while angle not in range(-360, 360):
	 if angle > 360:
		angle -= 360
	 elif angle < -360:
		angle += 360

I have tried restarting the engine and rewriting it but still gives an error on this line:

while angle not in range(-360, 360):
:bust_in_silhouette: Reply From: Inces

compiler expects “:” after “angle”, because You mistook the syntax and placed “not” in the wrong place. It should go :

while not angle in range(-360, 360):