1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nlexa [21]
3 years ago
11

Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase

words should take precedence over lowercase words. For example, 'Z' comes before 'a'. I am stuck on this python assignment. Don't need the answer asap, just some explaining of how to write code to do that. I know about the built in sort function
Computers and Technology
1 answer:
satela [25.4K]3 years ago
5 0

Answer:

Read the file and save it to a variable as a string, split the string variable and cast it to a set object using the set function to get the unique words in the file. Then use the max function with the key attribute to use regular expression module "re" to compare the first letter of each item to return in a list comprehension or append to a list.

Explanation:

The open function is used to import a file in python, the split string method splits the string to a list of items and the set function removes any duplicates of a word or item.

Using the for loop statement, iterate over the items and compare and return the items in alphabetical order with the 're' search method getting the item with uppercase letters with higher precedence than lowercase.

You might be interested in
When reading data across the network (i.e. from a URL) in Python 3, what method must be used to convert it to the internal forma
insens350 [35]

Answer:

The answer is "String decode( ) method".

Explanation:

In python programming, the Decode() function is used to convert or decodes the string by using the encoding codec. It is also used to convert the string parameters into the desired encoding scheme from the encoding system.

  • The encoding system is worked against this feature.
  • The decode method converts data into UTF-8 format.
  • This method works as a decoder that encodes the string values and returns its original value.

3 0
3 years ago
What best describes presentation software?
Oduvanchick [21]
It seems that you have forgotten the essential options to answer this question. But anyway, hope this answer will help you find what you are looking for.
When we say presentation software, this is a software that is used <span> to display information in the form of a </span>slide show<span>. It allows you to format text, include graphic images and present the content in a slide show. Hope this helps.</span>
5 0
3 years ago
To access WordPad, Jill will click on Start, All Programs, Accessories, and WordPad. To access Notepad, Karl will click on Start
Tamiku [17]
Jill is... But Windows 8.x doesn't exactly have a start menu... So it will depend on the version of Windows...
6 0
3 years ago
Which of the following is adoptable in Mindanao only?​
RUDIKE [14]

Answer:

there isnt any options

Explanation:

8 0
3 years ago
Which ONE of these usability goals is more important when designing software that someone would use only once or twice, such as
shepuryov [24]

Answer:

In the given scenario option B. Learnability is correct

Explanation:

Because user doesn't visit causally but only once or twice in this scene user must learn from design and interface instead of remember some steps So option B. Learnability is more suitable here. In other scenario where user visits site repeatedly then both are of equal importance is correct option.

5 0
3 years ago
Other questions:
  • A software program that enables users to find and display information stored as html pages on the internet is a(n) ____.
    5·1 answer
  • EDI decreases ______
    15·1 answer
  • Average of Grades - Write a program that stores the following values in five different variables: 98, 87, 84, 100, 94. The progr
    8·1 answer
  • "Two technicians are discussing FWD driveshaft service. Technician A says that removal of the driveshaft usually requires partia
    15·1 answer
  • All phones must have a way of making and then terminating a connection to the phone network; however the exact procedure for doi
    12·1 answer
  • ______________ helps you see how your document will appear on the paper. ​
    10·1 answer
  • The data in a database management system that identifies the names of​ tables, fields in each​ table, and the properties of each
    13·2 answers
  • Can someone please help me on these short short questions marking Brainly computer modeling people please help
    14·1 answer
  • What are some specific ways that businesses use the internet?
    6·2 answers
  • So whenever I play among us, I always get killed. Like always. I want to know some Technics to being a crew mate and an impostor
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!