The user enters the site name and the program must independently check what this site is:
Suppose the user enters: Google
The program must check what kind of site: google.com or google.ru and so on …
And if this site exists, then open it
Answer 1, Authority 100%
So far, no one who really knows those who really answer, I see this way on the basis of the question, such an outline:
import requests
Domens = ['.ru', '.com', '.rf', '.net', '.org', '.ru.net', '.pro', '.ua',]
DEF Check_Site (Site_Name):
For Domen in Domens:
Site = F'Https: // www. {site_name} {Domen} '
Try:
Response = Requests.get (Site)
Print (F'Na site "{site}" can go ')
Except:
Print (F'Site "{Site}" does not open ')
Check_Site ('Google')
Result:
to the site "https://www.google.ru" you can go
To the site "https://www.google.com" you can go
Site "https: //www.google.rf" does not open
On the site "https://www.google.net" you can go
To the site "https://www.google.org" you can go
Site "https://www.google.ru.net" does not open
Site "https://www.google.pro" does not open
To the site "https://www.google.ua" you can go