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")
# 今天的学习还是很简单的那 类比学习感觉很快的
相关推荐
段一凡-华北理工大学1 小时前
工业智能体:从Codex/Claude到项目实战~系列文章05:从“AI助手“到“工业智能体“:能力跃迁与落地范式
人工智能·python·claude·codex·工业智能体·高炉炼铁智能化
深蓝AI1 小时前
ContextVar 到线程池就丢了?asyncio.to_thread 和 run_in_executor 实测
python
岁月宁静3 小时前
什么是 Agent:从"会聊天"到"会做事"
人工智能·python
岁月宁静3 小时前
AI 应用开发工程师简历怎么写:HR 初筛、技术复筛、面试追问,三道关卡各看什么?
人工智能·python·面试
来让爷抱一个3 小时前
Python 异步里混用同步库,事件循环被卡住的全过程
开发语言·python
小肝一下5 小时前
3.基础语法(3)
python
深蓝AI6 小时前
Python 子进程树:父进程被杀后,孙进程为何还在跑?
python
心祭丫丫6 小时前
【每天一个 Python 小案例17】Python 实现通讯录
开发语言·人工智能·笔记·python·学习
爱你真是太好了6 小时前
Skill 索引瘦身与渐进加载
python
贾公子6 小时前
检测链路的容量规划——用 Little's Law 算清 QPS、并发与积压
后端·python