2019年8月14日

字符串操作、数据类型转换

摘要: 字符串主要操作方法: st = 'hello kitty'print(st.count('l')) #统计元素出现次数print(st.center(50,'#')) # 居中print(st.startswith('he')) # 判断是否以某个字符串开头print(st.find('t')) # 阅读全文

posted @ 2019-08-14 21:27 一抹天空 阅读(184) 评论(0) 推荐(0) 编辑

牛刀小试-购物车

摘要: #author:张浩 #date:2019/8/14 list_goods = [ ['iphone6s',5800], ['mac book',9000], ['coffee',30], ['python book',80], ['bicycle',1500] ] while True: salary = input('请输入充值金额:') ... 阅读全文

posted @ 2019-08-14 11:27 一抹天空 阅读(110) 评论(0) 推荐(0) 编辑

导航