(Display nonduplicate words in ascending order)Write a program that prompts the user to enter a text in one line and displays all the nonduplicate words in ascending order.
Sample Run
Enter a text: Good morning Good afternoon Good evening
Good afternoon evening morning

Answers

Answer 1
Answer:

The programreturns uniqueelements in the string passed in with no duplicates. The programis written in python 3 thus :

text = input('Enter text : ')

#promptsuserto enterstring inputs

split_text = text.split()

#splitinputtedtext basedonwhitespace

unique = set(split_text)

#usingtheset function,takeonlyuniqueelementsin thestring

combine = ' '.join(unique)

#usethejoinfunctiontocombinethestringstoformasingle lengthstring.

print(combine)

Asamplerunoftheprogramisattached

Learn more : brainly.com/question/15086326

Answer 2
Answer:

Answer:

The program to this question as follows:

Program:  

value = input("Input text value: ") #defining variable value and input value by user

word = value.split() #defining variable word that split value

sort_word = sorted(word) #defining variable using sorted function

unique_word = [] #defining list

for word in sort_word: #loop for matching same value

   if word not in unique_word: #checking value

       unique_word.append(word) #arrange value using append function

print(' '.join(unique_word)) #print value

Output:

Input text value: Good morning Good afternoon Good evening

Good afternoon evening morning  

Explanation:

In the above python code, a value variable is defined that uses input function to input value from the user end, and the word variable is declared, which uses the split method, which split all string values and defines the sort_word method that sorted value in ascending order.

  • Then an empty list "unique_word" is defined, which uses the for loop and inside the loop, a conditional statement is used.
  • In if block, it matches all value is unique if this is condition is true it will arrange all values and uses the print function to print all value.  


Related Questions

Travis and Craig are both standard users on the network. Each user has a folder on the network server that only they can access. Recently, Travis has been able to access Craig's folder.This situation indicates which of the following has occurred?
Write an if/else statement that assigns 0 to x when y is equal to 10; otherwise it should assign1 to x.
create a Java program that prompt the user to enter a number of hours, wages, over time factor, then your program should calculate the employee total wages. Make sure your program can calculate the over time and regular wages if number of hours are great than 40 hours. Use 1.5 for over time factor. Make sure your Java code has comments showing declarations and description of your variables.
Which of the following tools is specifically designed to test the dc voltage on a hard disk drive
In the glare of the sun, it is hard to see and be seen. Name six precautions

Blank spaces or unseen control characters in a data file are referred to as

Answers

Answer:

White spaces or WHITESPACE

What do you think is the single greatest physical threat to information systems? Fire? Hurricanes? Sabotage? Terrorism? Something else? Discuss this question and provide support for your answer.

Answers

Answer:

The single greatest physical threat to information systems is:

Sabotage

Explanation:

Sabotage describes the efforts of internal persons to ensure that a system does not operate as intended or is destroyed.  Among the threats to information systems, this is the greatest.  The problem with sabotage is that the operators are internal, they know the system very well.  They understand the weak points and the strengths of the system.  They are internal terrorists to any information system.  These internal saboteurs are capable of using any means to achieve their purpose.  Therefore, it is necessary to scrutinize employees from time to time to discover internal risks.

Describe how data is transmitted using half-duplex serial data transmission.

Answers

Half-duplex serial data transmission allows for communication in both directions, but only one direction at a time. In applications such as walkie-talkies and traditional telephone systems.

In half-duplex serial data transmission, data is transmitted in one direction at a time

1. Sender initiates transmission: The sender, also known as the transmitter, starts the data transmission process. It prepares the data to be sent and waits for the appropriate time to start transmitting.

2. Sender sends data: The sender begins sending the data in a sequential manner. It breaks down the data into smaller units called frames or packets.

3. Receiver acknowledges receipt: After receiving each frame, the receiver acknowledges its successful reception to the sender.

4. Sender waits for acknowledgment: Upon sending a frame, the sender waits for the receiver's acknowledgment. If an acknowledgment is received, the sender proceeds to send the next frame.

5. Receiver processes the data: The receiver receives the frames and processes the data within each frame. It checks for errors using techniques like checksums or cyclic redundancy checks (CRC).

6. Roles switch for bidirectional communication: Once the sender finishes transmitting its data, the roles switch and the receiver becomes the sender, initiating its own transmission.

7. Communication continues: The process continues as the receiver sends its data and waits for acknowledgments, while the new sender processes the received data and sends acknowledgments.

Overall, half-duplex serial data transmission allows for communication in both directions, but only one direction at a time. This type of transmission is commonly used in applications such as walkie-talkies and traditional telephone systems.

Learn more about half-duplex serial here;

brainly.com/question/33829144

#SPJ3

Answer:

In half duplex mode, the signal is sent in both directions, but one at a time. In full duplex mode, the signal is sent in both directions at the same time. In simplex mode, only one device can transmit the signal. In half duplex mode, both devices can transmit the signal, but one at a time.

Juan Garcia is the network administrator for a small company that also maintains its own web server. He has taken the following precautions: All the computers are patched, have antivirus software, and have unneeded services shut down. The network has a firewall with proxy server and IDS. The organization has a policy requiring passwords of ten characters in length, and must be changed every 90 days. Has Juan done enough to secure the network

Answers

Answer:

Yes Juan has done enough to secure the network

Explanation:

All the computers are patched, have antivirus software, and have unneeded services shut down - this is done to prevent malware from residing in the system.

The network has a firewall with proxy server and IDS - the firewall limit access to network so as to limit intrusion into the network

The organization has a policy requiring passwords of ten characters in length, and must be changed every 90 days - this is done to prevent leakage of sensitive information in the network especially when there is a compromise in the network.

If you have a list consisting of just numbers, then you can add all of the values in the list using the sum() function. If your list consists of some numbers and some values of other types (e.g., lists, strings, sets), the sum() function will fail. In this question, we're asking you to write a function that will sum all of the numbers in a list, ignoring the non-numbers. The function below takes one parameter: a list of values (value_list) of various types.


The recommended approach for this:

(1) create a variable to hold the current sum and initialize it to zero,

(2) use a for loop to process each element of the list,

(3) test each element to see if it is an integer or a float, and, if so, add its value to the current sum,

(4) return the sum at the end.


student.py 1


Hef sum_lengths(value_list):

# Implement your function here. Be sure to indent your code block! Restore original file

Answers

Answer:

See explaination

Explanation:

def sum_lengths(value_list):

total = 0

for x in value_list:

if (type(x)==int) or (type(x)==float):

total += x

return total

. How are returnspredicted in modern microprocessors?

Answers

Answer:

Return are predicted in the modern microprocessor as, branch predictor is the modern method for the processor for the prediction. The basic function of the branch predictor is improving in the pipeline instruction. It is basically the important part for implement the execution and the pipe lining. And the return predicted uses the call by reference technique for the data in instruction.