摘要: #!/user/bin/env python cars = ['audi','bmw','subaru','toyota']for car in cars: if car == 'bmw': print(car.upper()) else: print(car.title()) # == !=# < 阅读全文
posted @ 2018-10-30 22:14 alfred_hong 阅读(104) 评论(0) 推荐(0) 编辑
摘要: magicians = ['alice','david','carolina']for magician in magicians: print(magician) print(magician.title() + ",that was a great trick!") print("I can't 阅读全文
posted @ 2018-10-30 22:13 alfred_hong 阅读(178) 评论(0) 推荐(0) 编辑
摘要: print('hellow world') """ 多行注释"""#大小写print('i love you')mssage='hellow world'print(mssage)name=('ada lovelace')print(name.title())print(name.upper())print(name.lower())# 字符串拼接 【建议使用join】first_name=... 阅读全文
posted @ 2018-10-14 11:01 alfred_hong 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 转载http://blog.51cto.com/1193432/1671058 阅读全文
posted @ 2018-09-04 22:07 alfred_hong 阅读(131) 评论(0) 推荐(0) 编辑