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
Which is a primary document?<br> a. letter<br> b. dictionary<br> c. textbook<br> d. website
just olya [345]
Its B because a primary document means something with a <span>source or evidence</span> that gives u a lot of information.
6 0
3 years ago
Movie recommendations? I’m in middle school so nothing nasty bro and I don’t really like horror movies so none of those either
lbvjy [14]

Answer:

watch happy gilmore

Explanation:

5 0
3 years ago
Read 2 more answers
Consider the expression 3 * 2 ^ 2 &lt; 16 5 AndAlso 100 / 10 * 2 &gt; 15 - 3. Which operation is performed second?
miss Akunina [59]

Answer:

In the first expression

3 * 4 will be performed second.

In the second expression

10* 2  will be performed second.

Explanation:

In many programming language, there is an operator precedence where the operator (e.g. +, - , * , / etc) will be executed following a specific order. For example, the operator ^ which denotes power will always be executed prior to * or /    and if / and * exist in the same expression, the operator positioned at the left will be executed first.

Hence, in the expression 3*2^2 < 16 , 2 will be powered to 2 (2^2) first and then only multiplied with 3.

In the expression 100 / 10 * 2 > 15 - 3,  100 will be divided by 10 and then only multiplied with 2.

7 0
4 years ago
In a contract, what is consideration
Mrac [35]
Do you wan the definition ?
3 0
3 years ago
Attribute that contains only digits as a character data type instead of a numeric data type
oee [108]
<span>Sometimes a number sequence is pointless as a number. for instance, you would never perform a mathematical function on a phone number or social security number, but you might want to use them as string types - for instance to append or remove an area code or something.</span>
5 0
4 years ago
Other questions:
  • Query: [mcdonalds Austin] Viewport: Fresh User Location: within Houston, TX Result Returned: McDonalds location in a neighboring
    7·1 answer
  • Determine the value of base x of (211)x=(152)8
    8·2 answers
  • Lance is at a bus station. His friend is using the ATM machine to withdraw some money. Lance notices a stranger deceptively watc
    6·2 answers
  • 1. Think about the various ways in which you have seen hackers portrayed in popular media over the past few years. Are they hero
    11·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • . A program will ""fall through"" a case section if it is missing the __________ statement.
    15·1 answer
  • The options are file protection , fault-tolerance , fault line , file tolerance , and the question is which term describes the d
    6·1 answer
  • Felicity wants to capture the attention of the regular subway commuters in her area though her print advertisements​
    13·1 answer
  • Who is maintain data and time of computer?​
    5·1 answer
  • Amber is a hacker who steals information when people enter their personal details on specific websites. She intercepts the publi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!