Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with list
#2
Your indentation is wrong, it should be giving you an IndentationError on line 9. Assuming that's just a mistaking in pasting the code, you need to unindent the print statement to be the same level as the for statement. As it is now it is under the for statement, so it's part of the loop and prints every time through the loop. You just want it to print once at the end of the loop, so unindent it once to take it out of the loop.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
problem with list - by darktitan - Jul-27-2018, 03:51 PM
RE: problem with list - by ichabod801 - Jul-27-2018, 07:00 PM
RE: problem with list - by darktitan - Jul-27-2018, 10:13 PM
RE: problem with list - by darktitan - Jul-28-2018, 06:34 AM
RE: problem with list - by Axel_Erfurt - Jul-28-2018, 07:11 AM
RE: problem with list - by darktitan - Jul-28-2018, 07:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with "Number List" problem on HackerRank Pnerd 5 2,163 Apr-12-2022, 12:25 AM
Last Post: Pnerd

Forum Jump:

User Panel Messages

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