Jun-27-2020, 12:11 PM
Hi people,
I am trying to get line numbers depending if the line starts with "T.C." however list is empty and printing the number list gives me nothing.
input receives the text there are no problems with that however if returns nothing even tough text has strings starting with "T.C."
I am trying to get line numbers depending if the line starts with "T.C." however list is empty and printing the number list gives me nothing.
input receives the text there are no problems with that however if returns nothing even tough text has strings starting with "T.C."
def verial(): input1 = text1.get("1.0",'end-1c') satırsayısı=0 isimsatırlistesi=list() for line in input1: satırsayısı=satırsayısı+1 if line.startswith("T.C."): #bir satır T.C. ilebaşlıyorsa satırsayısını int cinsinden isim satırlistesine ekliyorum isimsatırlistesi.append(int(satırsayısı)) print(satırsayısı)