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
our client, Rhonda, has come to you for advice. Rhonda has recently graduated from college and has a good job with a large compa
Radda [10]

Answer:

See explaination for how to manage her personal risk

Explanation:

Personal risks can be described as anything that exposes you to lose of money. It is often connection to financial investments and insurance.

The basic things She can do to manage her personal risks are:

1. Saving:

Savings in much ways drastically reduces the percentage of risks and help you build confidence. Savings can help Rhonda manage her personal risks as savings helps one become financially secure and provide safety in case of emergency.

2. Investing:

After savings comes the major process, which is investment. It is rightly said, savings without invested proper is vain. Investment not only gives you returns or generates more profits but also ensures present and future long term financial security.

3. Reduce expenses:

A common man's expenses can never finish except it is controlled. Reduction in daily expenses can give a hike in savings and increase return on investment. Prompt planning can help cut in expenses.

5 0
3 years ago
There are a variety of common user interfaces. How would you decide which interface to use and on what should this decision be b
enot [183]

Answer: There are many different types of user interfaces. To decide on the user interface depends entirely on the requirement of the client.

Explanation:

There are different types of interfaces such as command line user interface, graphical user interface, menu based, form based. Therefore to choose among them it depend on the requirement specified by a client. Mostly nowadays GUI is used. to maintain records form based is preferred. For system software CUI is better due to decrease its pressure on the processor. Networking is also both GUI and CUI. So it depend mainly on the type of application developed , client requirements, power consumption based on its dependence on processor power.

5 0
3 years ago
A network technician is planning to update the firmware on a router on the network. The technician has downloaded the file from
zhenek [66]

Answer: B. Perform a hash on the file for comparison with the vendor’s hash.

Explanation:

Before installing the firmware update, the step that the technician should perform to ensure file integrity is to perform a hash on the file for comparison with the vendor’s hash.

Hashing refers to the algorithm that is used for the calculation of a string value from a file. Hashes are helpful in the identification of a threat on a machine and when a user wants to query the network for the existence of a certain file.

5 0
2 years ago
Software that interprets commands from the keyboard and mouse is also known as the
Anni [7]

Software that interprets commands from the keyboard and mouse is also known as the Operating System, your Operating System controls the basic functionalities of your device including executing commands from your keyboard and mouse.

4 0
2 years ago
Which Tire would you use to explain a set of phones in an HTML document?
timama [110]

Answer:

<dl> tag is used to describe things

So, it is used to create a definition list

So, answer is <dl> , definition list

3 0
2 years ago
Other questions:
  • When a browser makes a request for a static web page, the web server a. finds the HTML for the page and renders it b. renders th
    11·1 answer
  • ____ policy establishes criteria for classifying and securing the organization's information in a manner appropriate to its leve
    6·1 answer
  • I can create spreadsheets in Google Draw. False True
    14·2 answers
  • The ability for a protocol or program to determine that something went wrong is known as_________.
    15·1 answer
  • . Constructors can / cannot (circle correct choice) be called explicitly as if they were regular member functions.
    10·1 answer
  • How do you know if your phone has a virus?
    13·1 answer
  • This is a text message that is stored on a user's computer by a Web server that helps trace the user's browsing habits. a. Scrip
    14·1 answer
  • C:\windows\system32\drivers\etc\protocol is an example of a file ________. select one:
    5·1 answer
  • Python: Bad input on line 8. What is the fix, please can someone tell me I’m desperate?
    10·1 answer
  • _____ are fields that are used to personalize a mail merge document
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!