Python Forum
Basic if/then help (I'm sorry)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic if/then help (I'm sorry)
#3
I have the updated code that for testing purposes I am cutting / pasting from a editor to the console and it is still producing that error.

But, if I place the code into a file (test.py) and run the code the results are fine.

Would I need to implicitly place a CR to force a line or is there an easier way to do this from editor to console? Want to ensure I can iterate through code changes.

Thanks.

fruits=['apples', 'bananas', 'oranges']
vowel_names=[]
print(vowel_names)
for i in fruits:
    if i[0] in "aeiou":
        vowel_names.append(i)
        
print(vowel_names)
Reply


Messages In This Thread
Basic if/then help (I'm sorry) - by racichb - Aug-29-2019, 07:21 PM
RE: Basic if/then help (I'm sorry) - by Yoriz - Aug-29-2019, 07:45 PM
RE: Basic if/then help (I'm sorry) - by racichb - Aug-29-2019, 08:30 PM
RE: Basic if/then help (I'm sorry) - by ThomasL - Aug-30-2019, 08:02 AM
RE: Basic if/then help (I'm sorry) - by perfringo - Aug-30-2019, 08:33 AM

Forum Jump:

User Panel Messages

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