摘要: if语句 格式: if 条件: 语句 elif 条件: 语句 else: 语句 and 且 or 或 not if 'apple' not in fruits: print('') 布尔表达式 True False 字典 dict = {'name': 'huluwa' , 'age': 1} pr 阅读全文
posted @ 2021-06-16 18:11 把孤独当晚餐 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 操作列表 遍历列表 fruits = ['apple','banana','pear'] for fruit in fruits: print(fruit) #缩进表示在循环体内 print('done!') #不缩进是循环体外,避免缩进错误 使用range()创建数字列表 numbers = li 阅读全文
posted @ 2021-06-16 16:10 把孤独当晚餐 阅读(66) 评论(0) 推荐(0) 编辑