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
Ira Lisetskai [31]
3 years ago
8

Write a test program that prompts the user to enter a two dimensional array and displays the location of the smallest element in

the array.
Computers and Technology
1 answer:
alexandr1967 [171]3 years ago
8 0

Answer:

def element_loc():

   is_end = 'n'

   dimen2 = []

   while is_end == 'n':

       par1 = input("Enter rows and columns: ").split(",")

       part = [int(i) for i in par1]

       dimen2. append(part)

       is_end = input("Do you want to add more rows? y/n: ")

   mini = list()

   for i in dimen2:

       mini. append(min(i))

   result = min(mini)

   row_index = mini. index(result)

   col_index = dimen2[row_index]. index(result)

   print("Row: ", row_index, "Col_index: ", col_index)

element_loc()

Explanation:

The python program solution above prompts users for the two-dimensional array and then the rows of the array are compared with the minimum value stored in another list or array. The row index and the column index are gotten from the mini and dimen2 arrays respectively and are displayed as the position of the minimum value in the two-dimensional array.

You might be interested in
Write the function mystrchr(). the function has two parameters: a const char * s pointing to the first character in a c-style st
GrogVix [38]
<span>c. return a pointer to the first appearance of c appearing inside s and nullptr (0) if c does not appear inside s.</span>
7 0
3 years ago
What is the definition of legal intrusion
AleksAgata [21]
My answer -

intrusion of rights, right of privacy, trespass

P.S

Happy to help you have an AWESOME!!! day ^-^
5 0
3 years ago
Please find one organization that has recently adopted virtualization and summarize their reasons for taking this approach. What
Mamont248 [21]

Answer:

Harley-Davidson Motor Company

Explanation:

Harley-Davidson produces and sells custom-made, touring as well as cruiser motorcycles that feature elegant styling,  modern innovative design, and high quality performance with the ability to customize to ones taste.  Harley-Davidson moved 95% of their x86 server workloads to virtualized environments utilizing VMware infrastructures as of 2018. They report to have being able to have higher system availability, effective and simple disaster recovery capabilities, improved operation efficiencies, and cloud-ready infrastructure. One of the major challenges of virtualization is Security, Virtual systems can easily get compromised.

8 0
3 years ago
How does a computer work
ivann1987 [24]

Answer:

computer works on electricity

Explanation:

6 0
2 years ago
Identify a major drawback of browsing web pages on mobile devices.
Pavlova-9 [17]
It was way too much of a drawback
5 0
3 years ago
Other questions:
  • Which is the correct sequence of steps for opening a new document?
    10·2 answers
  • Page UND
    8·1 answer
  • Explain word processing ​
    11·2 answers
  • What is not true about contracts?
    12·2 answers
  • Examine the following declarations and definitions for the array-based implementations for the Stack and Queue ADTs. Assume that
    14·1 answer
  • Define the following term. data, database, DBMS, database system, data- base catalog, program-data independence, user wen', DBA,
    12·1 answer
  • Camila wanted to increase the readability of her company newsletter. To do this, she added _____.
    7·2 answers
  • 236. A system such as a printer, smart TV, or HVAC controller, typically uses an operating system on what is called a:
    13·2 answers
  • Write a program that first reads a list of 5 integers from input. Then, read another value from the input, and output all intege
    5·2 answers
  • What plugs into this?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!