关于索引和数字判断的小例子

## 计算用户输入 input内容中,索引为奇数并且and 对应的元素为数字isdigit的个数(没有则为0)
count = 0
content = input("请输入内容>>>>")
for i in range(len(content)):
if i % 2 == 1 and content[i].isdigit():
count = count + 1
print(count)
原文地址:https://www.cnblogs.com/www-qcdwx-com/p/10233600.html