SE ESCREVA NO NOSSO CANAL:

NOSSO MENU

Mostrando postagens com marcador matriz em python. Mostrar todas as postagens
Mostrando postagens com marcador matriz em python. Mostrar todas as postagens

sábado, 5 de outubro de 2019

matriz em python

# mais sobre matriz
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
x = 0y = 0soma = 0for x in range(0, 3):
for y in range(0,3):
matriz[x][y] = int(input(f'digite os valores [{x},{y}]'))
for x in range(0, 3):
for y in range(0, 3):
print(f'a matriz é [{matriz[x][y]}]')
if matriz[x][y]%2 ==0:
soma += matriz[x][y]
print('A soma e {}'.format(soma))

matriz em python

# mais sobre matriz
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
x = 0y = 0soma = 0for x in range(0, 3):
    for y in range(0,3):
        matriz[x][y] = int(input(f'digite os valores [{x},{y}]'))
for x in range(0, 3):
    for y in range(0, 3):
        print(f'a matriz é [{matriz[x][y]}]')
        if matriz[x][y]%2 ==0:
             soma += matriz[x][y]
print('A soma e {}'.format(soma))