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
ddd [48]
3 years ago
3

Write a function that takes in a string as input and returns a list of the unique characters used in the string. Punctuation sho

uld not be counted as a unique character. For our purposes you may consider the following characters as punctuation: .,;:?!"'- Your list should return all letters as lower case and sorted. So for example if the input is ' Happy days are here again!' your function should return the list

Computers and Technology
1 answer:
cricket20 [7]3 years ago
6 0

Answer:

def texted():

   text= input("Enter Text: ")

   text = text.lower()

   

nlist = ' '

   for char in text:

       if char.isalnum() == True:

           if char not in nlist:

               nlist = nlist + char

           

   nlist = sorted(nlist)

   print(nlist)

   return;

texted()

Explanation:

Step 1:

Define the function, i.e give it a name.

<em>def texted(): </em>

<em />

Step 2:

Prompt the user to input a string i.e Text

<em>text= input("Enter Text: ") </em>

<em />

Step 3:

use the lower() string method. it is a method in python used to convert uppercase string characters to lower case.

<em>text = text.lower() </em>

<em />

Step 4:

Declare an empty string variable that will be used to store the characters while sorting.

<em>nlist = ' ' </em>

<em />

Step 5:

<em>for char in text: </em>

<em>        if char.isalnum() == True: </em>

<em>            if char not in nlist: </em>

<em>                nlist = nlist + char </em>

<em />

-Use a for loop to iterate through all the characters in the text.

-<em>.isalnum()  </em>is a method in python that returns true if a character is an alphabet or a number.

The first if statement checks if it is an alphabet or a number and if it passes as true, it passes that alphabet or number to the next if statement.

- The second if statement checks if the character is not already in the list, if it is in the list it would not add it a second time.

If the character is not in the list, it adds the character to the list.

Step 6:

- sorts the list, i.e arranges the list in an alphabetical order.

- prints out the list, i.e produces an output of the list to your computer screen.

<em>nlist = sorted(nlist) </em>

print(nlist)

  • <em>texted() this is used to call the function. </em>

You might be interested in
How technology bacome the mode of revealing​
maria [59]

Answer:

afefdasf

Explanation:

3 0
3 years ago
What is the answer ????​
gtnhenbr [62]

Answer:

<h2>iv. NINGUNO DE LOS ANTERIORES</h2>

Explanation:

<h2>Hola</h2>
8 0
3 years ago
When is it not necessary to invoke the method myMethod using dot notation? When myMethod is private. When myMethod is invoked by
Paraphin [41]

Answer:

When myMethod is invoked by a method in the same class as myMethod.

Explanation:

When you are in a class, it is like a different enviroment and within that class you can call a method without using the dot notation because you are still within the class.

Outside the class and despite the type of method, public, private or static, the dot notation will be required.

5 0
3 years ago
Read 2 more answers
A system is being developed to help pet owners locate lost pets. Which of the following best describes a system that uses crowds
Slav-nsk [51]

Crowdsourcing  is used by mobile application that allows users to report the location of a pet that appears to be lost.

<h3>What is a mobile application?</h3>

A mobile application is known to be a kind of computer app or program that has been made to handle or run itself on a mobile device e.g. phone,  etc.

Conclusively, the option that best describes a system that uses crowdsourcing is the mobile application that allows users to report the location of a pet that appears to be lost and upload a photo that is made available to other users of the application and thus everyone can help to look for it.

Learn more about mobile application  from

brainly.com/question/9477543

#SPJ1

6 0
2 years ago
Which statement best describes the Tell Me feature in PowerPoint 2016?
Bumek [7]

A statement best describes the Tell Me feature in PowerPoint 2016 is that: D. it opens a search field that can be used to look up old versions of presentations.

<h3>What is PowerPoint 2016?</h3>

PowerPoint 2016 refers to a software application that was designed and developed by Microsoft Inc., so as to avail its end users the ability to create various slides which can be used during a presentation.

In PowerPoint 2016, the Tell Me feature is a tool which opens a search field that can be used by end users to look up or search old versions of presentations.

Read more on PowerPoint here: brainly.com/question/26404012

#SPJ1

6 0
2 years ago
Other questions:
  • A four year old laptop will not boot and presents error messages on the screen
    8·1 answer
  • A Python function cannot under normal circumstances reference a module variable for its value.
    12·2 answers
  • Write a C++ program that prompt the user to enter v in meter/second(m/s) and the acceleration in a in meters/second squared (m/s
    15·1 answer
  • Nuclear batteries use devices called thermocouples, which convert the ____ of a nuclear reaction into electricity.
    9·1 answer
  • What is a 96.1791 weighted gpa in a 4.0 scale?
    8·1 answer
  • Divide 111001 by 1101​
    7·1 answer
  • Difference between automated testing and manual testing
    13·1 answer
  • To create an SSL connection, a Web server requires a ________, which is an electronic document that confirms the identity of a w
    12·1 answer
  • How many parameters can we use in each function?
    15·1 answer
  • Imagine that a team of scientists test a certain hypothesis, and the experimental results show that it is false.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!