Why is for loop not working among the phrases listed in a line?
Semicolon cannot be used to separate 8. Compound statements — Python 3.8.6rc1 documentation. Only simple statement are allowed.
And the one-line for statement will probably confused with Comprehensions:
print(x) for x in range(20)  
print(x); for x in range(20): pass

Why can't use semi-colon before for loop in Python? - Stack Overflow
bash - Python command line argument semicolon-loop error - Stack Overflow