Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. class Website:
  2.     def __init__(self, host, domain, queries):
  3.         self.host = host
  4.         self.domain = domain
  5.         self.queries = queries
  6.  
  7.  
  8. list_of_websites = []
  9. while True:
  10.     data = input().split(" | ")
  11.     if data[0] == "end":
  12.         break
  13.     host = data[0]
  14.     domain = data[1]
  15.     query = []
  16.     if len(data) == 3:
  17.         query = data[2].split(',')
  18.  
  19.     website = Website(host, domain, query)
  20.     list_of_websites.append(website)
  21.  
  22. for site in list_of_websites:
  23.     if site.queries:
  24.         print(f"https://www.{site.host}.{site.domain}/query?={'&'.join(map(lambda x: '[' + x + ']', site.queries))}")
  25.     else:
  26.         print(f"https://www.{site.host}.{site.domain}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement