1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Calculate Specific column in 2D list python [duplicate]

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    im new in python. still learning the syntax and method. i have a nested list for data about ordered menu:

    orderedFood = [
    ["meatball", 2, 10000],
    ["pizza",1, 15000],
    ["fried Noodle", 3, 45000]
    ]


    the index[0] is food name (str),

    the index[1] is quantity (int),

    the index[2] is total price(int)

    how can i calculate the sum of index[2] (all the total price) for counting the total bills for example?

    Thx in advance

    Continue reading...

Compartilhe esta Página