Quick actions

cmd+k|ctrl+k

Navigation

Languages

Augmented Assignment Operator

Snippet info

Language

Python

Visibility

public

Author

harshdeepsaini2757

Created

2025-11-01T20:29:56.41685Z

Updated

2025-11-01T20:29:56.41685Z

# Augmented Assignment Operator
some_value = 5
# some_value = some_value + 2  # Wrong Practice

some_value += 2     # Right Practice


print(some_value)


counter = 0

counter += 1
counter += 1
counter += 1
counter += 1
counter -= 1
counter *= 2

print(counter)
INFO