Advertisement
dtroonn

Untitled

Dec 8th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. with open('D:\python1\PAMPAM.txt',encoding='utf-8') as s:
  2. a=[line.split() for line in s]
  3. m=[]
  4. with open('D:\python1\PAMPAM.txt','w',encoding='utf-8') as s:
  5. for i in a:
  6. for k in i[:len(i)-1]:
  7. print(k,file=s,end = ' ')
  8. b=float(i[len(i)-1])
  9. b = b - b*0.2
  10. print(b,file=s)
  11. print(' ')
  12. m.append(b)
  13. n=str(max(m))
  14. with open('D:\python1\PAMPAM.txt',encoding='utf-8') as s:
  15. a=[line.split() for line in s]
  16. def f(x):
  17. for i in a:
  18. for k in i:
  19. if k == x:
  20. print('Информация о самом дорогом товаре,после уменьшения цены на 20%: ',*i)
  21. f(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement