a = input("First statement : ")
b = input("Second statement : ")
c = input("Third statement : ")
al = a.split()
bl = b.split()
cl = c.split()
counte = 0
counter = 0
letter = 0
bll = ""
vowels = 0
ans = 0
ansb = 0
ansc = 0
print(f"The words in first statement is {len(al)}")
print(f"The words in second statement is {len(bl)}")
print(f"The words in third statement is {len(cl)}")
print(f"Total words {len(al)+len(bl)+len(cl)}")
for i in al:
g = len(i)
letter += g
for vow in range(0, len(i)):
if i[vow] == 'a' or i[vow] == 'i' or i[vow] == 'e' or i[vow] == 'o' or i[vow] == 'u':
vowels += 1
if i[0] == 'e':
counte += 1
if i[g-1]+i[g-2] == "re":
counter += 1
for j in bl:
h = len(j)
letter += h
for vow in range(0, len(j)):
if j[vow] == 'a' or j[vow] == 'i' or j[vow] == 'e' or j[vow] == 'o' or j[vow] == 'u':
vowels += 1
if j[0] == 'e':
counte += 1
if j[h-1]+j[h-2] == "re":
counter += 1
for k in al:
u = len(k)
letter += u
for vow in range(0, len(k)):
if k[vow] == 'a' or k[vow] == 'i' or k[vow] == 'e' or k[vow] == 'o' or k[vow] == 'u':
vowels += 1
if k[0] == 'e':
counte += 1
if k[u-1]+k[u-2] == "re":
counter += 1
print(f"The total letters is {letter}")
print(f"The words starting with e is {counte}")
print(f"The words ending with er is {counter}")
# Reversing the second statements
revb = b[::-1]
print(f"The second statement reversed : {revb}")
# Third statement reverse word by word
for words in bl:
words = words[::-1]
bll += words+" "
print(f"The third statement reversed word by word : {bll}")
print(f"The total number of vowels is {vowels}")
li = ['0', '1', '3', '2', '4', '5', '6', '7', '8', '9']
for gh in al:
for ff in range(len(gh)):
if gh[ff] in li:
ans = 967
print("Numbers are there in first statement ")
break
for ghk in bl:
for ffd in range(len(ghk)):
if ghk[ffd] in li:
ansb = 9673
print("Numbers are there in second statement ")
break
for ghks in cl:
for fffd in range(len(ghks)):
if ghks[fffd] in li:
ansc = 96733
print("Numbers are there in third statement ")
break
if ans == 0:
print(" No Numbers are there in first statement ")
if ansb == 0:
print(" No Numbers are there in second statement ")
if ansc == 0:
print(" No Numbers are there in third statement ")
#Code is Completed
1条答案
按热度按时间q3qa4bjr1#