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
joja [24]
3 years ago
11

Write a program that inputs a sentence from the user (assume no punctuation), then determines and displays the unique words in a

lphabetical order. Treat uppercase and lowercase letters the same.
Computers and Technology
1 answer:
yan [13]3 years ago
4 0

Answer:

Following are the code to this question:

val={} #defining dictionary variable val

def unique_word(i):#defining a method unique_word    

   if i in val: #defining if condition to add value in dictonary          

       val[i] += 1#add values  

   else: #defining else block to update values        

       val.update({i: 1})#updating dictionary

s =input('Enter string value: ') #defining s variable for input string value

w=s.split()#split string value and sorte in w variable

w.sort() #sorting the value  

for i in w: #defining loop for pass value in method unique_word

   unique_word(i)#assign value and calling the unique_word method

for j in val:# defining for loop to print dictionary value  

   if val[j] == 1: #defining if block to check value is unique  

       print(j) #print value

Output:

Enter string value: my name is dataman

dataman

name

is

my  

Explanation:

  • In the above python code, a dictionary variable "val" is declared, which is used in the method "unique_word" that uses if block to count unique word and in the else block it update its value.
  • In the next step, s variable is declared, that the user input method to store the value and another variable "w" is defined that split and sort the string value.
  • In the last step, two for loop is declared in which the first loop passes the string value and calls the method "unique_word", and in the second loop if block is defined that check unique value and prints its value.
You might be interested in
How can you make your MakeCode micro:bit program display either the letter<br> A or the letter B?
Liula [17]

Answer:

Use a random number and control structure to decide which letter is displayed.

Explanation:

8 0
3 years ago
Ethics issues are significant in the area of online privacy because laws have not kept pace with the growth of the Internet and
raketka [301]

Answer:

The answer is "True"

Explanation:

In the given statement some information is missing that is "True or false"

Internet security is the scope of the privacy and security of the electronic exchange of data. It's a common term that refers to something like many factors, technologies, and technology used to protect records, contact, and interests, confidential and private.

  • The security of the Internet is recognized as the privacy of the User.
  • It is secure and unique passphrases or two-factor authentication.
7 0
3 years ago
Which feature of a blog allows an author to interact and get feedback from his or her readers? link pingback commenting TweetMem
poizon [28]
Commenting. When someone comments of a blog the blog's writer can comment back, to answer questions, etc.
6 0
3 years ago
A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
uysha [10]

Answer:

Security Tab is the correct answer.

Explanation:

The Security Tab will enable the users to authorize anyone to use that file or directory.Many clients deleted the security tab because After that nobody can alter the security privileges on the device.

  • With the help of the Security tab, we will minimize the ActiveX attacks on Internet Explorer. This option is available in the Internet Options of the dialog box.
  • Other options are incorrect because they are not related to a given scenario.
8 0
3 years ago
Who do you understand by term DATA give example? please give answer in own words​
xeze [42]

Answer:

The term data is simply defined as “facts and figures”. Each piece of data is a little fact that doesn't mean much on its own. The word data can be used for a singular fact or a collection of facts. It comes from the Latin word datum, meaning “something given”.Data is defined as facts or figures, or information that's stored in or used by a computer. An example of data is information collected for a research paper. An example of data is an email. ... Statistics or other information represented in a form suitable for processing by computer.

4 0
3 years ago
Read 2 more answers
Other questions:
  • 10.
    13·1 answer
  • In an inheritance situation, the new class that you create from an existing class is known as the:
    5·1 answer
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • What is the full form of bcc please tell​
    15·2 answers
  • how can you create fades with the smart tool? How can you specify the types of fade curves that are used with the smart tool?
    13·1 answer
  • 1.What is a keyboard layout.
    5·1 answer
  • Help plz,l didn’t pay attention in class
    7·1 answer
  • To simplify the conceptual design, most higher-order relationships are decomposed into appropriate equivalent _____ relationship
    11·1 answer
  • Read the attached paper titled A Survey of Coarse-Grained Reconfigurable Architecture and comment on it. Make sure to specifical
    5·1 answer
  • The impact of the destruction of train station on the budget of the minister of finance
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!