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")
# 今天的学习还是很简单的那 类比学习感觉很快的
相关推荐
Lupino1 小时前
别再只聊 AI 写代码了:技术负责人要把“变更治理”提到第一优先级
python·docker·容器
Flittly3 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(6)Context Compact (上下文压缩)
python·agent
曲幽14 小时前
FastAPI + PostgreSQL 实战:从入门到不踩坑,一次讲透
python·sql·postgresql·fastapi·web·postgres·db·asyncpg
用户83562907805119 小时前
使用 C# 在 Excel 中创建数据透视表
后端·python
码路飞21 小时前
FastMCP 实战:一个 .py 文件,给 Claude Code 装上 3 个超实用工具
python·ai编程·mcp
dev派1 天前
AI Agent 系统中的常用 Workflow 模式(2) Evaluator-Optimizer模式
python·langchain
前端付豪1 天前
AI 数学辅导老师项目构想和初始化
前端·后端·python
用户0332126663671 天前
将 PDF 文档转换为图片【Python 教程】
python
悟空爬虫1 天前
UV实战教程,我啥要从Anaconda切换到uv来管理包?
python
dev派1 天前
AI Agent 系统中的常用 Workflow 模式(1)
python·langchain