num=raw_input("enter range") def pract(num): i=0 numbers=[] while i<=(num): print "At the top i is %d"%i numbers.append(i) i=i+1 print"Numbers now :",numbers print "At the bottom i is %d"%i for x in numbers: print"numbers now:",x pract(num)The code is returning an infinte list i dont know whats the problem?help
Problem in Loop
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
problem program runs in a loop | jasserin | 0 | 802 |
May-18-2024, 03:07 PM Last Post: jasserin |
|
While Loop Problem | Benno2805 | 1 | 1,186 |
Sep-06-2023, 04:51 PM Last Post: deanhystad |
|
Loop reading csv file problem | faustineaiden | 1 | 2,149 |
Dec-11-2021, 08:40 AM Last Post: ibreeden |
|
Infinite loop problem | Zirconyl | 5 | 4,174 |
Nov-16-2020, 09:06 AM Last Post: DeaD_EyE |
|
Dataframe mean calculation problem: do we have to loop? | sparkt | 1 | 2,827 |
Aug-28-2020, 02:41 PM Last Post: sparkt |
|
Python loop problem | Kristenl2784 | 11 | 7,125 |
Jun-18-2020, 07:22 PM Last Post: buran |
|
Problem with append list in loop | michaelko03 | 0 | 2,149 |
Feb-16-2020, 07:04 PM Last Post: michaelko03 |
|
problem with for loop using integers | python_germ | 5 | 3,957 |
Aug-31-2019, 11:42 AM Last Post: jefsummers |
|
problem in loop | roseojha | 3 | 2,981 |
Aug-26-2019, 09:03 AM Last Post: perfringo |
|
Nested while loop problem + turtle | DreamingInsanity | 3 | 4,111 |
Jul-06-2019, 02:01 PM Last Post: DreamingInsanity |
Users browsing this thread: 1 Guest(s)