Python选择结构

条件结构出现时上下代码留出空行

weather = input("今天天气晴朗吗?")

 if weather == "晴朗"
 	print("女朋友要逛街...")
 	
print("程序结束")

if条件语句后非逻辑表达式

  1. python解释器会自动将数值类型:非零转换为True,0转化为False。

猜你喜欢

转载自blog.csdn.net/qq_37040516/article/details/86504273
今日推荐