0
Help
I entered this, the program writes "site is not defined". But I had previously specified the site variable... What's the matter? ------------------------------------------------------------------------------------------------------------ if search == "особенности": site = 'https://ru.m.wikipedia.org/w/index.php?stable=1&title' response1 = requests.get(site) print(response1) ------------------------------------------------------------------------
2 Réponses
0
Maybe because if the the conditional is False, there's nothing. You try either have an else statement or defining the site variable outside the conditional anf then manipulating it based on a conditional.
0
Well what is search variable ?
search = input("")
site = "No site"
if search == "your kyrill text":
site ="https://www.yourdomain.com"
response1 = request.get(site)
print(site)
Maybe like this ?