''
と()
を使わずに答えを返すにはどうすればよいですか?余分な ''と()を使わずに答えを返すにはどうすればいいですか
def analyze_text(text):
#removes all of the non-al charaters
new_string = ""
for eachLetter in text:
if eachLetter.isalpha():
new_string += eachLetter
#count the number of e
text_count_E = text.count("E")
text_count_e = text.count("e")
total_e = text_count_E + text_count_e
#gets the percentage of e
percentage = 100 * total_e/len(new_string)
return "The text contains ",len(new_string),"alphabetic characters, of
which",total_e,"(",percentage,")","are 'e'"
あなたの答えにリストより読みやすいコードを入力してください。 – ekhumoro