Python入门第三课

python 复制代码
# 入门第三课
#  关键字 if and or in not in == !=
car = 'g'
print(car == 'g')
print(car == 'dd')
if car != 'hh':
    print("wlcome to here ")
age = 33
print(age == 33)
print(age == 44)
age1 = 44
if age >=0 and age1 >= 0:
    print("nihao")
if age >=0 or age1 >= 0:
    print("hao")
now = ['a','c','d']
print('a' in now)
print('b' in now)
# 布尔表达式 基本和Java和C语言类似的
age = True
age = False
#  if-elif-else 结构
# 在这个结构 else 可以省略
# 中间的 elif 相比较于Java 是不一样的
# 中间的elif可以有多个
if 'aa' in now:
    print("nihao")
elif 'c' in now:
    print("ni")
elif 's' in now:
    print("hao")
# 今天的学习还是很简单的那 类比学习感觉很快的
相关推荐
SomeB1oody9 分钟前
【RustyML入门】6.0. 数学工具
开发语言·后端·机器学习·rust·教程
进制树1 小时前
【飞控开发实战·⑲】ROS2无人机开发环境搭建:Jazzy安装、工作空间与hello_drone节点实战
开发语言·安全·无人机·课程设计
zzzzzz3101 小时前
AI 助手最危险的不是报错,而是“看起来成功”:我给工作流加了四道保险
人工智能·python
牛马也想出海1 小时前
亚马逊爬虫代理IP:IP类型选择与配置指南
开发语言·php
用户8356290780512 小时前
如何使用 Python 将 PowerPoint 转换为 PDF 文档
后端·python
菜冻鱼2 小时前
Python-pytorch-高级技巧
开发语言·人工智能·pytorch·python·深度学习·神经网络·聚类
lpfasd1232 小时前
python webview打包版卡死、开发版正常
开发语言·python
用户8356290780512 小时前
如何使用 Python 为 PowerPoint 幻灯片添加切换效果
后端·python
weixin_461408582 小时前
npm npx yarn
开发语言·前端·javascript
菜冻鱼2 小时前
Python-pytorch-模型保存与加载
开发语言·人工智能·pytorch·python·深度学习·机器学习