Question: I need some help with an exercise. I am given the names of the ducklings are Jack, Kack, Lack, Mack, Nack, Ouack, Pack, and Quack.
I need some help with an exercise. I am given the names of the ducklings are Jack, Kack, Lack, Mack, Nack, Ouack, Pack, and Quack.
prefixes = 'JKLMNOPQ'
suffix = 'ack'
for letter in prefixes:
print(letter + suffix)
I need to put this code into a Python script and run it. It will print the names "Oack" and "Qack".How do I change the program so that it prints "Ouack" and "Quack" but leaves the other names the same.
Include the modified Python code and the output in your submission.
I also need to create three examples that show various kinds methods of string slices. I have to give brief descriptions to the examples that I make.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
