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
SOVA2 [1]
3 years ago
14

. Write a function called is_sorted that takes a list as a parameter and returns True if the list is sorted in ascending order a

nd False otherwise. Here, I want you to make use of the input function, where users could provide an input that would be the members of the list.

Computers and Technology
1 answer:
aalyn [17]3 years ago
8 0

Answer:

There are multiple ways to solve the given problem, I will be presenting the most simple and easy way of solving this problem in few lines of code.

Python code:

def is_sorted(user_list):

   return user_list == sorted(user_list)

user_list=input("Please enter a list: ")

user_list = user_list.split()

print(is_sorted(user_list))

print("Your list: ", user_list)

Explanation:

A function is_sorted is created which takes a list as input and using the sorted() function of python which returns true when the list is sorted in ascending order and returns false when the list is not sorted in ascending order.

Driver code includes getting input list from the user and using split() function to create a list separated by space then printing the output of is_sorted function and in the last printing the contents of that list.

Output:

Please enter a list: 1 3 6 9

True

Your list:  ['1', '3', '6', '9']

Please enter a list: 15 7  2 20

False

Your list:  ['15', '7', '2', '20']

You might be interested in
100 POINTSSSSSSS!!
lianna [129]

i need help on that too :cc

5 0
2 years ago
Hello people, I was wandering if I could get some people to complete this questionnaire for my business course. It would be very
madam [21]
What do I have to do
3 0
3 years ago
Brainly is brainly am I correct ​
Bezzdna [24]

Answer:

yes

Explanation:

its a app

hope it is correct

mark me as brainiest

7 0
3 years ago
Read 2 more answers
Whether you work in m-commerce, e-commerce, or brick-and-mortar commerce, to be successful you will need to be able to think cri
svlad2 [7]

Answer:

The answer is "Option c"

Explanation:

Decisions made in secret have always been critical. Hence the want to express it before your choice is made. It is all about how you express choice. In general, they need your presentation to explain the choice that you decided, how they created it, and how it implies for just the group, that you are approaching, and wrong choices can be described as follows:

  • In option a, It is used in the industry to interest.
  • In option b, It is use in communication mechanism.
  • In option d, It enables people to handle our activities or carry them out.
3 0
2 years ago
The User Datagram Protocol (UDP) is called the connectionless protocol because: It does not attempt to fix bad packets but resen
DochEvi [55]

Answer:

The User Datagram Protocol (UDP) is called the connectionless protocol because:

It does not attempt to fix bad packets or resend lost packets.

Explanation:

Ports are openings or entrance doors through which data packages have access to a PC or server.  TCP and UDP are transport protocols with port numbers.  TCP means Transmission Control Protocol.  They are used to connect two devices over the internet and other networks.  UDP means User Datagram Protocol.  They are used to connect applications and to speed the transfer of data.  Comparatively, UDP is faster, simpler, and more efficient than TCP.  TCP enables retransmission of lost data packets, which UDP cannot do.

4 0
2 years ago
Other questions:
  • Which statement best describes antivirus software
    12·2 answers
  • What tool enables you to easily delete, add, or resize filesystems without regard to their physical locations on a hard disk?
    13·1 answer
  • You recently upgraded your computer and added an extra 512 MB of RAM. Consequently, you want to increase your swap space by addi
    10·1 answer
  • How many inches do a tire have to be to sometimes be refer as bald of balding tries
    14·1 answer
  • Which custom configuration is most likely to include a raid array?
    14·1 answer
  • I need le help, darn ijourneys
    10·2 answers
  • Not every organization integrates with the Internet, but all use some or most of the technology that gave rise to it.
    15·1 answer
  • How to square a number in java.
    15·1 answer
  • GIF is example of raster image<br><br><br> RIGHT OR WRONG?
    15·1 answer
  • if you want to clear a single file, what move instruction would you use? group of answer choices none of the choices file to wor
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!