i know [-1]
but i don't understand [:-1] mean,,
ex)~~{}txt -> Number of births file
ls=()
for y in range(1990,2000):
filname = "~~{}.txt".format(y)
with open ("filename",'r') as f:
data=filename.realines()
for d in data():
if d[-1]:
d=d[-1]
birth=data.split(",")[2]
cnt += birth
ls.append(y,cnt)
with open("birth_year.csv","w") as f: for year,birth in ls: data ="{},{}\n".format(year,birth) f.write
what mean [:-1]???...
I am not good at coding. so,I'd appreciate it if you'd be kind enough to tell me know. thx