Collections.namedtuple()

  • + 0 comments

    You can actually forget about namedtuple and just do it old-fashined way ;) Could be shorter ~>_<~

    count, marksIndex = int(input()), input().split().index("MARKS")
    print(sum([int(input().split()[marksIndex]) for a in range(count)])/count)