Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Possible Duplicate:

(可能重复:)
Python: Behaviour of increment and decrement operators

(Python:增量和减量运算符的行为)

I've always laughed to myself when I've looked back at my VB6 days and thought, "What modern language doesn't allow incrementing with double plus signs?":

(当我回顾我的VB6时,我总是嘲笑自己,并且想:“现代语言不允许用双加号增加?”:)

number++

To my surprise, I can't find anything about this in the Python docs.

(令我惊讶的是,我在Python文档中找不到任何相关内容。)

Must I really subject myself to number = number + 1 ?

(我真的必须让自己受到number = number + 1吗?)

Don't people use the ++/-- notation?

(人们不使用++/--符号吗?)

  ask by Znarkus translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
309 views
Welcome To Ask or Share your Answers For Others

1 Answer

Python不支持++ ,但您可以这样做:

number += 1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...