May-21-2024, 02:56 PM
(May-21-2024, 02:48 PM)deanhystad Wrote: The next line after an "if" must be indented one level. Not doing so is a syntax error.
You normally don't type code like this in python. Normally you write code to a file and pass the filename as an argument to python.
myscript.py
x = 5 if x < 10: print("Smaller") # Must indent + 1 level if x > 20: # Must indent -1 level print("Bigger") print("finis")
Hiya, thanks for the reply,
Sorry, I had indented after the ifs, but it didn't show up that way when I pasted it into here. Unfortunately, the issue is persisting though, I tried using your code in Python, and as the attached screenshot shows, exact same issue is still ocurring.