['u', 'r', 'a', 'n', 'g', 'e ', ' ', 'b', 'a', 'n', 'a', 'n', 'a', 'u']
Оно должно вернуться:< /p>
оранжевый банан
Это код:
Код: Выделить всё
"""
9/25/24
replaces o's in fruit with u's
"""
#creates string list
fruitList=""
start=0
#takes input
while True==True:
fruit=str(input("Type the name of a fruit. Press Enter without typing to finish."))
if fruit=="":
break
fruitList=fruitList+fruit+" "
fruitRealList=list(fruitList)
while start
Подробнее здесь: [url]https://stackoverflow.com/questions/79028117/how-do-i-replace-items-in-a-list-and-then-print-that-list-with-natural-language[/url]