赞
踩
定义字符串变量name,内容为:“itheima is a brand of itcast”
通过for循环,遍历此字符串,统计有多少个英文字母:“a”
提示:
name = 'itheima is a brand of itcast'
i = 0
for x in name:
if x == 'a':
i += 1
print(f'ithenima is a brand of itcast中共含有:{i}个字母a')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。