subject

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
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, Jbutler15
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
image
Computers and Technology, 23.06.2019 07:00, Dvrsug8598
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
image
Computers and Technology, 23.06.2019 21:00, tiffg2588
Will this setup result in what kathy wants to print?
Answers: 2
image
Computers and Technology, 23.06.2019 21:20, nathanfletcher
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
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 in other subjects:

Konu
History, 06.10.2020 07:01
Konu
Mathematics, 06.10.2020 07:01
Konu
Mathematics, 06.10.2020 07:01