" ':' expected at end of line " but there is one.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sy_ph

here’s my code:

extends Panel
var a = ["test", 123, 1.5]
var b = "test"

func Check():
	if a not in b:
		print "hi"

It gives me an error saying error(6,5): ‘:’ expected at end of line.
but i did put one! Why is it saying that?

:bust_in_silhouette: Reply From: volzhs

wrong usage of not
if not a in b: will fix the problem.

Probably should open a proposal for that cause that’s a correct syntax in Python.

Dlean Jeans | 2019-12-26 15:29

GDScript isn’t Python. I see a lot of people suggesting things for GDScript “because it works in Python”, because they seem to think that GDScript is a Python clone.

Epidal | 2019-12-26 17:04

Lol thanks for the help. I came from python so ig it makes sense that was the problem.

sy_ph | 2020-01-04 22:20