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
What does the format painter button in excel do
wlad13 [49]
The format painter button in excel copies formatting from one place and it applies it to another
7 0
4 years ago
If a business industry does not meet OSHA standards
soldi70 [24.7K]

Explanation:

USE SOCRACTIC IT WOULD REALLY HELP

7 0
4 years ago
Read 2 more answers
What did Moore's Law explain?A.The power of microprocessors will double every two years.B.The power of microprocessors will incr
Maru [420]

A.The power of microprocessors will double every two years.

3 0
3 years ago
The gap in ease of access to technology is known as the ________ divide. Select one: A. technology B. Internet C. web D. digital
strojnjashka [21]

Answer:

D

Explanation:

Digital Divide

3 0
4 years ago
Read 2 more answers
How computer viruses spread from one computer to another​
morpeh [17]
Viruses spread when the software or documents they get attached to are transferred from one computer to another using a network, a disk, file sharing methods, or through infected e-mail attachments. Some viruses use different stealth strategies to avoid their detection from anti-virus software.
8 0
3 years ago
Other questions:
  • The photo-sharing site Instagram owed a good deal of its success to filters. What are filters?
    11·2 answers
  • Why is knowledge of percent composition important in the mining process?
    7·1 answer
  • In scratch coding what can I do with "when I recive messeage 1 "
    15·1 answer
  • Is it important for a writer to include voice and point of view in writing because... Plz help
    15·1 answer
  • When doing career research online, you always want to make sure you are viewing a reliable source, what factors about the websit
    10·2 answers
  • _____ is a software delivery approach in which an organization outsources the equipment used to support its data processing oper
    5·1 answer
  • Do You assign the Needs Met rating before assigning the page quality (PQ) rating?
    11·1 answer
  • What is the output?
    6·2 answers
  • Place the steps in order for adding an additional email account in outlook
    12·1 answer
  • The essential idea behind digital cite zen shop is that ____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!