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
Write<br> algorithm to read 100 numbers<br> then display the largest.
jekas [21]

Answer:

see picture

Explanation:

There is no need to store all the values, you can just keep track of the highest. Up to you to create a numbers file with 100 values.

3 0
3 years ago
What should software firm design for the VR sample at Museum?
gladu [14]

The software firm design for the VR sample at Museum is a 360-degree video that shows a walk through of the virtual studio of a famous artist that is aided by a narration about the various piece of art that the user wants to focus on.

<h3>How is VR used in museums?</h3>

VR is known to be a technology that puts the user inside the experience they are viewing. It is known to be a kind of  interactive or it is one that take the shape of 360-degree video.

The use of VR is done so as to form or create museum tours, so that exhibits in the museum can be interactive, and to bring the different scenes to reality.

Learn more about museums from

brainly.com/question/95815

5 0
3 years ago
Someone learn me more American Sign Language (ASL). Please.
sveticcg [70]

Answer:

Ok I will

Explanation:

3 0
4 years ago
A print server uses a print ________ as a software holding area for jobs waiting to be printed.
vichka [17]

Answer:

spooler

Explanation:

A print server uses a print spooler as a software holding area for jobs waiting to be printed.

8 0
3 years ago
Read 2 more answers
In cell B20, enter a
zzz [600]

Answer:

かあなたは棚田やヌタほたややあはあやあやあさあ与田弥太は沙汰やあはあわあね、田やホワアラハやくださいヤアカやさ矢田かほあや体は白湯のやさた

Explanation:

なたさたらなやさゆなやさら

5 0
2 years ago
Other questions:
  • Lena has secured her online website, which sells fashion apparel. She has taken all the necessary steps by making her website PS
    8·1 answer
  • After Intel faced strong shifts in technologies, such as cloud services, social networking, mobile devices, etc., Intel realized
    11·1 answer
  • I have six nuts and six bolts. Exactly one nut goes with each bolt. The nuts are all different sizes, but it’s hard to compare t
    12·1 answer
  • An expression involving byte, int, and literal numbers is promoted to which of these?
    12·1 answer
  • There are six different sequences for the three approval tasks: check inventory; check credit; check special terms.
    5·1 answer
  • Suppose that, on average, a certain binary search algorithm takes one second to search through 1,000 items. Approximately how lo
    9·1 answer
  • . Suppose that name is a variable of type string. Write the input statement to read and store the input Brenda Clinton in name
    5·1 answer
  • A macro enables you to automate repetitive tasks by
    5·1 answer
  • Adding videos to your website can be tricky because there may be problems making sure they will play in all
    13·1 answer
  • What is 4365 −3412 when these values represent
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!