Python Forum
option -c and semicolon not working as expected
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
option -c and semicolon not working as expected
#7
experimenting more instead of trying to find subtle rules in the language reference i found that ";" fails when it immediately follows ":" even though a newline can be there.

edit:

Output:
lt1a/forums/3 /home/forums 6> python3.8 -c 'for x in range(4):; print(x)' File "<string>", line 1 for x in range(4):; print(x) ^ SyntaxError: invalid syntax lt1a/forums/3 /home/forums 7> python3.8 -c 'for x in range(4): pass;print(x)' 0 1 2 3 lt1a/forums/3 /home/forums 8>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: option -c and semicolon not working as expected - by Skaperen - Aug-12-2022, 09:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020