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]
4 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]4 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
______ provide visual representations of the options available for a given command
anygoal [31]

The visual representations is provided by the Gallery in the computer system.

Basically, gallery means the collection of pictures in a Computer.

  • Gallery is what enables systematic display and the management of distinct images in the computer.

  • A very good illustration is use of Clipart images. It is a ready made picture gallery available in the computer.

  • Every function on computer are represented with an icon, the icon images are enable through the Gallery.

In conclusion, the Visual representations of the options available for a given command is provided by the Gallery.

Read more about Gallery here

<em>brainly.com/question/2946480</em>

5 0
3 years ago
Cations - Office 2016 A
Vika [28.1K]

Answer:

1345

Explanation:

6 0
3 years ago
Read 2 more answers
When right-clicking an object, a ____ menu appears, which contains frequently used commands related to the object.
jeyben [28]
When right clicking an object in word, Shortcut menu appears which contains frequently use commands that relate to the object
7 0
2 years ago
John have subscribed to a cloud-based service to synchronize data between your mobile device and your PC. Before allowing the da
xeze [42]

Answer: Mutual authentication

Explanation: Mutual authentication could be referred to a vetting process where the two entities in communication authenticate each other, it could also be referred to as a two-way authentication.

In the scenario above, the cloud service or server authenticates itself with the client and the client authentication itself with the cloud service server by verifying or vetting the certificates of both communicating entities before a secure encrypted connection would be established or created.

8 0
3 years ago
Read 2 more answers
____________ is the ability to stand up for your own interests and to ask for what you want. A. Discipline B. Arrogance C. Asser
devlian [24]
C. Assertiveness. Assertiveness is defined as confident and forceful behavior, so it is the only one that makes sense.
8 0
3 years ago
Read 2 more answers
Other questions:
  • ________ take computers with wireless connections through an area and search for unprotected wireless networks, and then monitor
    13·1 answer
  • During executing of the ______ PR task, units regain control of IP and transfer physical custody to the reintegration team.
    6·1 answer
  • Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual interest rate for each of the sav
    10·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • How much heat is needed to raise the temperature of 7g of water by 15oC?
    6·1 answer
  • Why was the cooper black font made?
    5·1 answer
  • This is my paragraph . The type of color is ude in this code line is ..............................
    5·1 answer
  • Rob is planning his housewarming party. He wants to design an invitation and personalize it for each invitee. He needs to create
    11·1 answer
  • Define a class named person that contains two instance variables of type string that stores the first name and last name of a pe
    14·1 answer
  • Define data, information and the relation between the two?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!