I just recently started using Python and I was wondering if there was a way to increase a value in a list.
DarkFeather
0
Newbie Poster
Recommended Answers
Jump to PostYes,
mylist[2] += increment
for example increments the third item in mylist. Lists are mutable objects in python, which means that every item in the list can be replaced by any other value.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.