Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Experience the ease of finding precise answers to your questions from a knowledgeable community of experts. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

8.5 Edhesive Code Practice
Use the following initializer list to create an array (this is also in your programming environment):

twainQuotes = ["I have never let my schooling interfere with my education.",
"Get your facts first, and then you can distort them as much as you please.",
"If you tell the truth, you don't have to remember anything.",
"The secret of getting ahead is getting started.",
"Age is an issue of mind over matter. If you don't mind, it doesn't matter. "]
Print this array, then use functions to sort the quotes. Then, print the quotes again.

Next, insert the quote "Courage is resistance to fear, mastery of fear, not absence of fear." at the correct spot alphabetically, and print the quotes again.

Hint: Your code should print the array after each modification listed in the instructions


Sagot :

Answer:

Check explanation

Explanation:

#Print original quote

twainQuotes = ["I have never let my schooling interfere with my education.",

"Get your facts first, and then you can distort them as much as you please.",

"If you tell the truth, you don't have to remember anything.",

"The secret of getting ahead is getting started.",

"Age is an issue of mind over matter. If you don't mind, it doesn't matter. "]

print(twainQuotes)

#Sort and print

twainQuotes.sort()

print(twainQuotes)

#Insertion of quote, sort, then print

twainQuotes.extend(["Courage is resistance to fear, mastery of fear, not absence of fear."])

twainQuotes.sort()

print(twainQuotes)

mark as brainliest pls hehe