Python’s Fake Increment and Decrement Operators

Content Source: Python Web Development

In Python, you can increase the value of a variable by 1 or reduce it by 1 using the augmented assignment operators. The code spam += 1 and spam -= 1 increments and decrements the numeric values in spam by 1, respectively.


Other languages such as C++ and Java have the ++ and -- operators for incrementing and decrementing variables. (The name of C++ itself reflects this; the name is a tongue-in-cheek joke that indicates it’s an enhanced form of the C language.) Code in C++ and Java could have ++spam or spam++. Python wisely doesn’t include these operators; they are notoriously susceptible to subtle bugs.

Reading more

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hey, such an interesting blog post, You have written this blog with a wonderful infomation and that helps me to get a chance to know more about the Hire angularJs Developer I really appreciate your work. Thank you so much!

    ReplyDelete
  3. putlocker offers students a team of dedicated experts who are professionals in writing assignments which can be on different subjects such as marketing, finance, nursing or accountancy at a very nominal fee.

    ReplyDelete
  4. This is one of the best article read in recent times. continue your good work.thanks for sharing with us.

    Inwizards LLC - Top Angularjs Developmant Company

    Hire Angularjs Developers

    Hire Angularjs Developer

    ReplyDelete

Post a Comment

Popular posts from this blog

Hire Top AngularJS Development Companies & Developers

Quickly Create Real Angular Prototypes Without Writing Code