Question: (a) Write two functions to sort words alphabetically and remove duplicate words from a sentence. (b) You have decided to invest in a new

(a) Write two functions to sort words alphabetically and remove duplicate words 

(a) Write two functions to sort words alphabetically and remove duplicate words from a sentence. (b) You have decided to invest in a new cryptocurrency. You have tracked the average monthly price of said cryptocurrency over a six-month period. Write a function that can calculate when you could have bought and sold a single token of the cryptocurrency to maximise your profit margins during this period. (c) Describe two edge cases where your cryptocurrency calculation algorithm might fail. (d) Write a function to find the longest word in a sentence. (e) Define two instances where commenting in Python provides value and provide an example for each case. [8] [8] [4] [6] [4] Activate Windows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer a Here are the two functions python def sortwordssentence words sentencesplit sortedwords sortedwords return joinsortedwords def removeduplicat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!