5.104.106.184
import random
def bosc_cremat (bosc):
'''
int --> none
Genera_matriu genera numeros random per una matriu de 50 x 10 i no retorna res
'''
arbres_sans = 0
for fila in range(len(bosc)):
arbres_cremat = 0
for col in range(len(bosc[fila])):
if (bosc[fila][col] == 1):
arbres_sans = arbres_sans + 1
else:
arbres_cremat = arbres_cremat + 1
if (((arbres_cremat/len(bosc[fila]))*100) >= 70):
print ("La Fila ",bosc[fila],"esta cremat es te que renovar")
'''
genera = [
['V','X','V','V'],
['V','V','V','X'],
['X','X','X','V']
]
'''
def genera_matriu (n_files,n_col):
'''
(int,int) --> list -- int
'''
m= []
for f in range(n_files):
#Añades otra lista dentro de la lista m para generar una matriz
m.append([])
for c in range(n_col):
#en la matriz añades 0 o 1 random
m[f].append(random.randint(0,1))
return m
genera = genera_matriu(50,10)
bosc_cremat(genera)