0

I have the below list:

list =[5,10,15,20,25,30]

...and I would like to keep the same list but have its elements increased by 5. How could we do this without creating a new list? What kind of loop should I create for this? Is there another way?

Thanks!

DYZ
  • 55,249
  • 10
  • 64
  • 93
DMach
  • 71
  • 1
  • 6
  • 1
    (1) Do not call your list `list` - `list` is a built-in list constructor. (2) You need a `for` loop. – DYZ May 20 '20 at 16:33
  • 1
    Does this answer your question? [Modify a list while iterating](https://stackoverflow.com/questions/44864393/modify-a-list-while-iterating) – DYZ May 20 '20 at 16:34

1 Answers1

0

If you want to add another list to the existing list you can use extend in-build functions.

please refer below link to know more about that: [https://www.geeksforgeeks.org/append-extend-python/][1]