www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  2912 随笔 :: 9 文章 :: 51 评论 :: 185万 阅读

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]'

 

posted on   秦瑞It行程实录  阅读(233)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· 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源
www.cnblogs.com/ruiyqinrui
点击右上角即可分享
微信分享提示