and运算符就是所谓的布尔运算符,连接两个布尔值,并且在两者都为真时返回真,否则 返回假,or not 可以随意结合真值
短路逻辑 short-circuit logic 惰性求值 lazy evaluation
raw_input 返回值为真
断言,条件后可以添加字符串,用来解释断言
x = 1
Yes = input('Are you readly?')
if Yes.lower() == 'yes':
while x <= 'yes':
print(x)
x += 1
缩进对Python 太重要了!
name = ''
while not name:
name = input('Please enter your name: ')
print('Hello,%s!' % name)
Name = input('Please input you name: ')
name = Name
while not name or name.isspace():
#while not name.strip() or while not name or name.isspace()
#
name = input('Please enter your name: ')
print('Hello,%s!'% name)
# sequence list words = ['this','is','an','ex','parrot']
#for word in words:
# print(word)
"""
numbers = [0,1,2,3,4,5,6,7,8,9]
for number in numbers:
print(number)
"""
'''
d = {'x':1,'y':2,'z':3}
for key in d:
print(key,'corresponds to',d[key])
#multiline commit for python
#one line commeit for Python
'''
'''
d = {'x':1,'y':2,'z':3}
print(d[key])
#for key in d:
# print(d[value])
'''
'''
d = {'x':1,'y':2,'z':3}
for key,value in d.items():
print(key,'correspond to',value)
'''
"""
names = ['anne','beth','george','damon']
ages = [12,45,32,102]
for i in range(len(names)):
print(names[i],'is',ages[i],'years old')
for string in strings:
if 'xxx' in string:
index = strings.index(string) # Search for the string in the list of strings
strings[index] = '[censored]'
"""
for string in srings:
if 'xxx' in string:
index = strings.index(string)
strings[index] = '[censored]'
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
2013-12-28 redhat 挂载 iso文件 提示 mount :not a directory
2013-12-28 oracle10g Error in invoking target 'install' of makefile
2013-12-28 Rhel6.0部署Oracle10g报错相关问题记录
2013-12-28 Rhel5.5配置Centos yum源