My question is not a duplicate because it is using turtle graphics. So I have to write a program that reads a csv
file which contains earthquake data, it then takes only the latitude and longitude from the file and map it to the turtle screen in Python 3.
This is the CSV file, please visit http://textuploader.com/gayg
My program:
import turtle
def drawQuakes():
filename = input("Please enter the quake file: ")
readfile = open(filename, "r")
readlines = readfile.read()
start = readlines.find("type")
g = readlines[start]
Type = g.split(",")
tracy = turtle.Turtle()
tracy.up()
for points in Type:
print(points)
x = float(points[1])
y = float(points[2])
tracy.goto(x,y)
tracy.write(".")
drawQuakes()
I know this program is fairly easy, but I keep getting this error:
x = float(Type[1])IndexError: list index out of range