Advertisement
aneliabogeva

Websites

Jul 16th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class Website:
  2. def __init__(self, host, domain, queries=None):
  3. self.host = host
  4. self.domain = domain
  5. self.queries = queries
  6.  
  7. command = input().split(' | ')
  8. data_list = []
  9.  
  10. while not command[0] == 'end':
  11. host = command[0]
  12. domain = command[1]
  13. #queries = command[2].split(',')
  14. if len(command) > 2:
  15. queries = command[2].split(',')
  16. website_info = Website(host,domain,queries=command[2].split(','))
  17. else:
  18. website_info = Website(host=host, domain=domain, queries=None)
  19. data_list.append(website_info)
  20. command = input().split(' | ')
  21.  
  22. for item in data_list:
  23. if item.queries == None:
  24. print(f"https://www.{item.host}.{item.domain}")
  25. else:
  26. print(f'https://www.{item.host}.{item.domain}/query?=', end='[')
  27. print(']&['.join(item.queries),end=']')
  28. print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement