Python | csv | Accumulate/Count | String | List

    0

    2

    Aaron Lefler

    file = open("charts.csv") file.readline() total = 0 love = "love"

    for line in file: linelist = line.split(",")

    loveIsDumb = linelist[2].lower()
    
    if love in loveIsDumb:
        total += 1
    

    print(total,"\n\nLooking for love in all the wrong places!\n")

    Shortcut: love

    file = open("charts.csv")
    file.readline()
    total = 0
    love = "love"
    
    for line in file:
      linelist = line.split(",")
    
      loveIsDumb = linelist[2].lower()
    
      if love in loveIsDumb:
        total += 1
    
    print(total,"\n\nLooking for love in all the wrong places!\n")
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.