1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Subtract specific indexed values from lists of list

Discussão em 'Python' iniciado por Stack, Setembro 27, 2021.

  1. Stack

    Stack Membro Participativo

    I have a list like

    l1 = [[403, 105], [403, 100], [403, 92], [403, 95], [403, 89]].


    I want to subtract 403 from all the 403s and check if the difference is 0.

    I again want to check the difference of 105 from 100, 92, 95 and 89 respectively and check the difference. The result I want to obtain is:

    diffelement1 = [0,0,0,0]
    diffelement2 = [5,13,10,16]


    Can someone please help me with this?

    Continue reading...

Compartilhe esta Página