Python 中的 ^=、-= 和 += 符号 [英] ^=, -= and += symbols in Python

查看:84
本文介绍了Python 中的 ^=、-= 和 += 符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Python 很有经验,但最近,当我查看

I am quite experienced with Python, but recently, when I was looking at the solutions for the codility sample tests I encountered the operators -=, +=, ^= and I am unable to figure out what they do. Perhaps could anyone explain the context in which they are used?

解决方案

As almost any modern language, python has Assignment Operators so they can use them every time you want to assign a value to a variable after doing some arithmetic or logical operation, both (assignment and operation)are expressed compact way in one statement....

这篇关于Python 中的 ^=、-= 和 += 符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆