So I have this code:
meme = int
meme = 1
import sys
data = int
if meme == 1:
lines = open('C:\Users\maksn\Desktop\A452\scores class 1').readlines()
new_data = []
for line in lines:
new_data.append(int(line.strip()))
print (new_data)
I want it to read string data but only the numerical values so I can later convert them to integers to sort out but I get this error: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
The text file at the moment has this in it:
kek got 4
kek got 2
kek got 10
Any help would be appreciated.
Edit:
Not sure if this is useful but the bracket after open is highlighted in red.