Question: Python program Modify the source code to get the output in descending order. unique.py - /Users/parth/Downloads/unique.py (3.9.1) 11 File: unique.py Project 5.7 Prints the unique

Python program

Modify the source code to get the output in descending order.

Python program Modify the source code to get the output in descending

unique.py - /Users/parth/Downloads/unique.py (3.9.1) 11 File: unique.py Project 5.7 Prints the unique words in a text file in alphabetical order. . # Take the input file name inName = input("Enter the input file name: ") # Open the input file and initialize list of unique words input File = open(inName, 'I') uniquewords = [] IDLE Shell 3.9.1 Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license()" for more information. =================== RESTART: /Users/parth/Downloads/unique.py ================== Enter the input file name: data5.txt Division GSU Governors Mathematics Programming Python Science State Technology University We Welcome and are at learning of to # Add the unique words in the file to the list for line in input File: words = line.split() for word in words: if not word in uniqueWords: uniqueWords.append(word) uniquewords. sort() # Prints the unique words for word in uniquewords: print (word) Source CODE OUTPUT Ln: 21 Col: 18 Ln: 25 Col: 4 data5.txt Welcome to Governors State University Division of Science Mathematics and Technology We are learning Python Programming at GSU DATA FILE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!