Python Forum
for / else not working in interactive mode
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for / else not working in interactive mode
#3
that doesn't work, either:

Output:
Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a=[1,2,3,4,9,6] >>> b=[0,5,10] >>> for x in b: ... if x in a: ... print('foo') ... break ... >>> else: File "<stdin>", line 1 else: ^ SyntaxError: invalid syntax >>>
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: for / else not working in interactive mode - by Skaperen - Jul-17-2019, 02:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  things that work in terminal mode but not in sublime mode alok 4 2,971 Aug-11-2021, 07:02 PM
Last Post: snippsat
  interactive map and function hurc60248 1 1,827 Jan-08-2021, 09:22 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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