Python Forum
problem with for loop using integers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with for loop using integers
#2
(Aug-31-2019, 02:49 AM)python_germ Wrote: Program seems to run fine,

Hmmm... I have my doubts: on line # 6 you convert aa to int and on line # 12 you create iterator from that. This would happen:

>>> aa = 5
>>> iter(aa)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: problem with for loop using integers - by perfringo - Aug-31-2019, 04:07 AM
RE: problem with for loop using integers - by buran - Aug-31-2019, 04:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem program runs in a loop jasserin 0 61 Yesterday, 03:07 PM
Last Post: jasserin
  While Loop Problem Benno2805 1 610 Sep-06-2023, 04:51 PM
Last Post: deanhystad
  Loop reading csv file problem faustineaiden 1 1,606 Dec-11-2021, 08:40 AM
Last Post: ibreeden
  Infinite loop problem Zirconyl 5 3,065 Nov-16-2020, 09:06 AM
Last Post: DeaD_EyE
  Dataframe mean calculation problem: do we have to loop? sparkt 1 2,212 Aug-28-2020, 02:41 PM
Last Post: sparkt
  Reading integers from a file; the problem may be the newline characters JRWoodwardMSW 2 2,037 Jul-14-2020, 02:27 AM
Last Post: bowlofred
  Python loop problem Kristenl2784 11 5,201 Jun-18-2020, 07:22 PM
Last Post: buran
  Problem with append list in loop michaelko03 0 1,715 Feb-16-2020, 07:04 PM
Last Post: michaelko03
  problem in loop roseojha 3 2,347 Aug-26-2019, 09:03 AM
Last Post: perfringo
  Nested while loop problem + turtle DreamingInsanity 3 3,024 Jul-06-2019, 02:01 PM
Last Post: DreamingInsanity

Forum Jump:

User Panel Messages

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