Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Question Protected by Jean-François Fabre
Post Reopened by Jean-François Fabre python
Post Closed as "Duplicate" by Jean-François Fabre python
added 6 characters in body; edited tags; edited title
Source Link
Dennis
  • 14.5k
  • 3
  • 51
  • 58

Add How to add an integer to each element (Python)in a list?

If I have list=[1,2,3] andlist=[1,2,3] and I want to add 11 to each element to to get the output [2,3[2,3,4],4] how would I do that?

I assume I would use a for loop but not sure exactly how.

Add an integer to each element (Python)

If I have list=[1,2,3] and I want to add 1 to each element to get the output [2,3,4] how would I do that?

I assume I would use a for loop but not sure exactly how

How to add an integer to each element in a list?

If I have list=[1,2,3] and I want to add 1 to each element to get the output [2,3,4], how would I do that?

I assume I would use a for loop but not sure exactly how.

Source Link
user1212818
user1212818

Add an integer to each element (Python)

If I have list=[1,2,3] and I want to add 1 to each element to get the output [2,3,4] how would I do that?

I assume I would use a for loop but not sure exactly how