Increment by 1
Input
increment(3)
Output
4
Default amount is 1, so 3 becomes 4.
Full lesson preview
Use augmented assignment to increment a numeric value by a given amount.
Problem statement
Task
Examples
Input
increment(3)
Output
4
Default amount is 1, so 3 becomes 4.
Input format
Output format
Constraints
Samples
Input
increment(10, 5)
Output
15
10 incremented by 5 equals 15.