Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filne = "arxeio.txt"
- import re
- with open(filne, 'r+') as f:
- for line in f:
- counter = 0.0
- if( line.startswith("ΑΦΜ")):
- #nea apodeiksh
- a=line[5:]
- a=int(a)
- try:
- a += 1
- except TypeError:#sfalma sto afm
- break
- k=next(f)
- #print ('k=',k)
- while(k.startswith("ΣΥΝΟΛΟ")==0 and k.startswith("-")==0):
- k=re.sub(r'.*:', ':', k)
- k=k[1:]
- w=k.split()
- print('Για το προιον αυτο τα μαθηματικα ειναι :',((float((w[1])))*float(w[0]))==float(w[2]))
- print(counter)
- counter=float(w[2])+counter
- print(k)
- k=next(f)
- if (k.startswith("ΣΥΝΟΛΟ")):
- if(float(k[7:])==counter) :
- print('============σωστό σύνολο================',counter)
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement