# 统计英文句子"python is an interpreted language"有多少个单词,有多少个字母 'a'
# count split
import math
def test1():
str = 'python is an interpreted language'
str_list = str.split(" ")
print(len(str_list))
print(str.count('a'))
# 使用input 输入一个字符串,遍历每一个字符来判断它是不是全是小写英文字母或者数字
def test02():
str = input('输入一个字符串:')
english = 0
number = 0
for item in str:
if 'a' <= item <= 'z': english += 1
if '0' <= item <= '9': number += 1
if english == len(str):
print('全是小写字母')
elif number == len(str):
print('全是数字')
else:
print("其他")
# 统计一个英文字符串中每个字母出现的次数
def test03():
str &#