![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 20.02.2021 02:10 xcrysttallx
Words are way more edgy when you replace the letter i with an exclamation point!
Write the function exclamations that takes a string and then returns the same string with every lowercase i replaced with an exclamation point. Your function should:
Convert the initial string to a list
Use a for loop to go through your list element by element
Whenever you see a lowercase i, replace it with an exclamation point in the list
Return the stringified version of the list when your for loop is finished
Here’s what an example run of your program might look like:
exclamations("I like music.")
# => I l!ke mus!c.
exclamations("Mississippi")
# => M!ss!ss!pp!
This is my code:
my_string = input("Enter text: ")
my_list = list(my_string)
for item in my_list:
if item == "i":
print ("!")
my_list. remove("i")
else:
print (item)
(" ").join(my_list)
it is not correctly printing:
it is suppose to be a string not up and down like this
Enter text: mississippi
m
!
s
!
s
!
p
!
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 12:30
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 21:40
is on drugs i swear i ask a question and its not showing whats going
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 23:00
Hypertension occurs when blood pressure is too high.
Answers: 1
You know the right answer?
Words are way more edgy when you replace the letter i with an exclamation point!
Write the function...
Questions
![question](/tpl/images/cats/himiya.png)
Chemistry, 26.04.2020 15:56
![question](/tpl/images/cats/biologiya.png)
Biology, 26.04.2020 15:56
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mkx.png)
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/mkx.png)
Arts, 26.04.2020 15:57
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2020 15:58
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2020 15:58
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2020 15:58
![question](/tpl/images/cats/himiya.png)
Chemistry, 26.04.2020 15:58
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/geografiya.png)
Geography, 26.04.2020 15:59
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/fizika.png)
Physics, 26.04.2020 16:01
![question](/tpl/images/cats/mat.png)
Mathematics, 26.04.2020 16:02