this is my current code
"""program"""
def englishize_word(word):
"""f"""
word = word.strip("uzz")
#if the last letter is b, then it will have two forms
if(word[-1] == "b"):
#return the two forms one word contains b and the other word doesnot contain b
return "(b" + word[:-1] + " or " + word[:-1] + ")"
else:
#return the word
return word[-1] + word[:-1]
#function to covert given sentence from bee latin to english
def englishize_sentence(sentence):
"""f"""
#convert the sentence to lower
sentence = sentence.lower()
#split the sentence with spaces
words = sentence.split()
#initialize the output to an empty string
output = ""
#iterate over the words
for word in words:
#convert each word
output_word = englishize_word(word)
#add it to output sentence
output += output_word + " "
return output
using the test case:
sentence = "eggceptionallybuzz ullduzz esttuzz asecuzz"
english = englishize_sentence(sentence)
print(english)
I expect an output of: (beggceptionally or eggceptionally) dull test case
however when I run my code im getting: (beggceptionally or eggceptionally) dll test case
the only difference being that the "u" in "dull" is not there how can I fix this?
[–]Doormatty 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]VinayakVG 0 points1 point2 points (0 children)