0
CHALLENGE OF THE QUESTION 1 | Now, do not forget to inform which is the position of this higher value.
There’s no way I can show the position of the highest value:
from random import randint
matriz_10x10 = []
for linha in range(10):
linha = []
for coluna in range(10):
linha.append(randint(0, 10000))
matriz_10x10.append(linha)
for linha_matriz in matriz_10x10:
print(linha_matriz)
This returns me to the following list:
[9084, 3990, 7211, 8670, 7057, 1310, 172, 6029, 7080, 2736]
[1039, 5584, 94, 428, 2429, 8719, 7838, 9331, 9274, 3163]
[166, 664, 5928, 656, 4576, 2585, 9654, 3071, 530, 9457]
[8563, 969, 9464, 2161, 3446, 718, 5524, 4919, 8249, 2624]
[2436, 1633, 1146, 2718, 4335, 5981, 772, 1345, 2126, 888]
[9860, 8196, 7874, 2661, 3504, 9538, 4872, 7993, 8629, 6598]
[8, 527, 5426, 4970, 8553, 5912, 2510, 396, 1304, 8640]
[4661, 1554, 4380, 2625, 6098, 4635, 9876, 503, 5484, 2131]
[8612, 1953, 2372, 6697, 4973, 7691, 8735, 4418, 7584, 3881]
[3561, 8265, 9219, 5248, 1018, 9481, 51, 8268, 3733, 9293]
maior_valor = 0
for linha in matriz_10x10:
for coluna in linha:
if maior_valor < coluna:
maior_valor = coluna
print(maior_valor)
Retorna: 9876
Now comes the part that shows the position of the value 9876 in the list... Does anyone have any idea?
You need to create two variables, row and column, which update whenever the highest value is found.
– G. Bittencourt
I tried to do this, but I am beginner in python, these problems were passed on to me as a challenge. .
– Dark_Lord