Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 9, 2020 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/eea43a0eaaa28b683f12cc31755a4d33 to your computer and use it in GitHub Desktop.
Save parzibyte/eea43a0eaaa28b683f12cc31755a4d33 to your computer and use it in GitHub Desktop.
import csv
"""
https://parzibyte.me/blog
"""
nombre_archivo = "videojuegos.csv"
with open(nombre_archivo, "r") as archivo:
lector = csv.reader(archivo, delimiter=",")
# Omitir el encabezado
next(lector, None)
for fila in lector:
# Tenemos la lista. En la 0 tenemos el nombre, en la 1 la calificación y en la 2 el precio
nombre = fila[0]
calificacion = int(fila[1])
precio = float(fila[2])
print(
f"Juego: '{nombre}' con calificación {calificacion} y precio {precio}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment