Python “多元”賦值
資料來源: https://github.com/stormzhang/free-programming-books/blob/master/assets/python/Python核心编程(中文第二版)带目录.pdf 的p65~p66
# -*- coding: UTF-8 -*- #Python 程式過長時的換行語法[\] + 多元賦值 weather_is_hot,shark_warnings=1,0 #weather_is_hot=1;shark_warnings=0
if (weather_is_hot == 1) and \ (shark_warnings == 0): print(shark_warnings); print(weather_is_hot);
|