0
[[3, 2, 7], [8, -2, 5], [-1, 4, 3], [2, 2, -9]]
Then it stores in three distinct variables, ignoring the negative values, the sum of the elements separately. That is, the sum of the first element of each sub-list, the sum of the second element of each sub-list and the sum of the third element of each sublist. Then create a dictionary with the key/value match of the numbers 1 to 15, for example:
{1:"Um", 2:"Dois" … 15:"Quinze"}.
Finally, by matching the result value to the dictionary key, it presents the result individually in text form.
I started with this code. My first question is to cycle for if else
? How do I get only the positives added? What do I call the blocks? In the same way as in the lists 0,1,2,3?
lista=[[3,2,7], [8,-2,5], [-1,4,3], [2,2,-9]]
var1=""
var2=""
var3=""
for int in range(len(lista))
if (int in lista)
var1=
On this page has a brief tutorial on lists, can help you.
– Pagotti