'list' object has no attribute 'values' when we are using append in python
It is basically what the error message says. The problem is this:

y =y.values().astype(int)


y is a list and lists do not have a method values() (but dictionaries and DataFrames do). 

If you would like to convert y to a list of integers you can use list comprehension:

y = [int(x) for x in y]


Or alternatively use map (but I'd prefer the list comprehension):

y = list(map(int, y))


Since this is actually a coding related question you might want to consider posting on https://stackoverflow.com next time.