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
torisob [31]
3 years ago
6

Ask the user to enter the number of elements in a list of numbers. Take in the numbers from the user and then output the list th

e user entered . Followed by the list the user entered with only the 2nd half sorted. NOTE: You may assume the user will enter a list with an even number of elements. You should sort only the 2nd half the first half is to remain as is.

Computers and Technology
1 answer:
m_a_m_a [10]3 years ago
4 0

Answer:

#Section 1

   lst= []

   lstNo=int(input("Enter even number of elements in List: "))

   for i in range(0, lstNo):

       pr=int(input(": " ))

       lst.append(pr)

   print(lst)

#Section 2

   nlst=[]

   dlst=[]

   n =len(lst)

   i=0

   while (i < n/2):

       nlst.append(lst[i])

       i = i+1

   j = n-1

   while j >= n/2:

       dlst.append(lst[j])

       j = j-1

   dlst.sort()

   for a in range(len(dlst)):

       nlst.append(dlst[a])

   print(nlst)

       

Explanation:

#section 1:

An empty list is declared to hold the list inputs by the user <em>lst= [] </em>

The program then prompts the user to enter an even number of elements that will be contained in the list.

The for loop is used to iterate from zero(0) to the number of elements stated, in order to get the input that is appended to the list.

lastly, the list is printed out.

#Section 2:

In this section two new lists are created to hold one half of the value respectively.

The first list collects the first half of the list using a while loop and stores it, it does not perform any sorting on it.

The second list collects the second half using a while loop and sorts the list using the<em> .sort()  </em>method which arranges elements in an ascending order.

Finally, the second list that has been sorted is added to the first and the result is printed to the screen.

A picture of how the code will run has been attached.

 

You might be interested in
Pros of mobile devices on young people during their free time
Elis [28]
Studies have shown that the people who spend more time on social media are better to show virtual empathy to their online friends 
8 0
3 years ago
What is communication ​
Aneli [31]
What we are doing right now. It’s interactions with one another person or persons
3 0
3 years ago
Read 2 more answers
What do you think about the argument that word processing reduces the quality of writing?
slava [35]
<span>I believe when you're given a sufficient amount of time you are able to write your thoughts clearly than when you're given a short period of time to answer questions or make an argument on an essay BUT there is a drawback with the tools within the word processing. Word processing comes with a spell check but it does not correct homonyms such as they're, their and there or other homonyms. My experience with word processing is that I always need time to effectively write something and that helps me make less grammatical mistakes when I take my time to write and edit my paper, I guess it all depends on the individual in their writing skills

I hope this helps!
</span>
5 0
4 years ago
When several computers connected to the Internet have been set up to forward spam and sometimes viruses to other computers on th
balu736 [363]

Answer:

Option D: Botnet

is the correct answer.

<h3>When several computers connected to the Internet have been set up to forward spam and sometimes viruses to other computers on the Internet, <u>Botnets </u>are responsible. </h3>

Explanation:

A Botnet can be taken as the combination of two words "robot" and "networks". Botnets are used in depicting the malicious content as the breach the network security. They are used for stealing data by Distributed Denial of Service attack (DDoS) and by sending spam to all other devices connected to a network. All this scheme is managed by the attacker itself.

All other listed options spread malicious data by some other means.

I hope it will help you!

4 0
3 years ago
How can you re-engage users who have abandoned your app after their first use?
Volgvan

The first of the several steps you should take is to find out why your users are leaving the app. Once you find out, you’ll then be able to make the right strategy and re-engage. You can add a feedback option and prompt the users to share some of their experiences. In addition, you can use tracking tools and analytics. 

Besides these, you can also use deep linking, build re-marketing lists, offer something unique to understand your most loyal users and make sure you do a proactive outreach through emails and push notifications.






6 0
4 years ago
Read 2 more answers
Other questions:
  • A ____ is any manipulation of data, usually with the goal of producing information.
    9·1 answer
  • Allow chrome to access the network in your firewall or antivirus settings. if it is already listed as a program allowed to acces
    15·1 answer
  • Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of eac
    11·1 answer
  • You often travel away from the office. While traveling, you would like to use a modem on your laptop computer to connect directl
    5·1 answer
  • Suppose that a t-shirt comes in five sizes: S, M, L, XL, XXL. Each size comes in four colors. How many possible t-shirts are the
    11·1 answer
  • Which component of the computer keeps the operating system when the computer is running​
    10·1 answer
  • What is one example of the use of an infrared sensor?
    13·2 answers
  • When is it appropriate to utilize the nat network connection type?
    8·1 answer
  • A(n) _____________ changes the order in which instructions are carried out by directing the computer to execute a statement else
    12·1 answer
  • What are three ways digital identity is created and kept up? (open answer)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!