标签:dig 练习 使用 mat 计算 用户输入 index 分割 upper
s = "asdfer" index = 0 while index < int(len(s)): a = s[index] print(a) index += 1
s = "asdfer" for i in s: print(i)
content = input("请输入式子:") index = content.find("+") a = int(content[0:index]) b = int(content[index + 1:]) print(a + b)
content = input ("请输入内容:") count = 0 for i in content: if i.isdigit(): count += 1 print("数字的个数为:{}" .format(count))
li = ["林风", ["林彬", "赖玉英", "赖狗屎"], "林静", "林圣翔", "林鹏"] li[1][0] = li[1][0].replace("彬", "兵") print(li)
# 方法一: lis = [2, 3, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"] lis[3][2][1][0] = lis[3][2][1][0].upper() print(lis) # 方法二: lis = [2, 3, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"] lis[3][2][1][0] = lis[3][2][1][0].replace("t", "T") print(lis)
标签:dig 练习 使用 mat 计算 用户输入 index 分割 upper
原文地址:https://www.cnblogs.com/lin961234478/p/10321236.html