定义字符串变量name,内容为:"itheima is a brand of itcast
通过for循环,遍历此字符串,统计有多少个英文字母:"a
i=0 name="itheima is a brand of itcast" for x in name: if x=='a': i+=1 print(f"itheima is a brand of itcast中共含有:{i}个字母a")
定义字符串变量name,内容为:"itheima is a brand of itcast
通过for循环,遍历此字符串,统计有多少个英文字母:"a
i=0 name="itheima is a brand of itcast" for x in name: if x=='a': i+=1 print(f"itheima is a brand of itcast中共含有:{i}个字母a")