Advertisement
AskTomorrow

Untitled

Feb 28th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. x = ''
  2. PriceList = []
  3. NameList = [[]]
  4. SectionList = []
  5.  
  6. while (x != '!'):
  7.     x = input()
  8.     if x == '!':
  9.         break
  10.     price, name, section = x.split('-')
  11.    
  12.     PriceList.append(int(price))
  13.     NameList.append(name.split())
  14.     SectionList.append(section)
  15.    
  16. n = int(input())
  17. sum = 0
  18.  
  19. for i in range(len(PriceList)):
  20.     if len(NameList[i]) == n:
  21.         sum += 0.1 * PriceList[i]
  22.    
  23. print(f'Скидка {sum} рублей')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement