found error when naming variables with basic functions how to replicate while=123 #while should be treated as variable name while True: #this should be treated as a function print while #this should be as a variable name result: File "C:\Users\_you got served_\Desktop\bugs.py", line 1 while = 123 ^ SyntaxError: invalid syntax
This is not a bug. "while" is a keyword, it is part of Python's syntax, and you are not permitted to use keywords as variable names. This is not an accident, but a deliberate decision.