python - 2 variables = 1 other variables
问题描述
I want to know if we can simplify a code in Python:
a = 5
b = a
c = a
d = a
...
解决方案
简化示例的唯一方法是使用链式赋值。
a = b = c = d = 5
推荐阅读
- xml - Src-resolve.4.2:解决组件“ds:签名”的错误
- apache-spark - Spark 中的用户特定属性文件(.hiverc 等效项)
- angular - 未捕获的 ReferenceError:系统未在 Angular 2 中定义
- javascript - Firebase 函数在执行简单操作时超时
- ssh - SSH 但不能 ping
- mongodb - 使用 --uri 参数时 mongodump 挂起
- html - Bootstrap 4卡水平滚动问题?
- java - Spring:在@Component+@Transactional 类线程中使用EntityManager 是否安全?
- python - Filter pandas column of lists based on a list
- html - 如图所示,如何更改页脚上方某个区域的背景颜色?我正在使用wordpress