[Python] my code is not running on python. But it should [closed]

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

  1. Stack

    Stack Membro Participativo

    I have used both python 9 and 12

    import csv

    with open("weather_data.csv") as data_file:
    data = csv.reader(data_file)
    temp = []
    for i in data:
    if i != "temp":
    temp.append(int(i[1]))
    print(data)



    I was expecting a list with full of integers but i am getting error ValueError: invalid literal for int() with base 10: 'temp'

    Continue reading...

Compartilhe esta Página