PDA

View Full Version : Python - What is the quick syntax to add 1 to a counter.?



tc101
July 29th, 2007, 11:46 PM
What is the quick syntax in python to add 1 to a counter.

counter = counter + 1

how do you do that with less typing

digby
July 29th, 2007, 11:51 PM
try counter += 1

vambo
July 29th, 2007, 11:52 PM
counter += 1

tc101
July 29th, 2007, 11:54 PM
Thanks