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) ------------------------------------------------------------------------

30th Jan 2023, 2:25 PM
python
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.
30th Jan 2023, 4:53 PM
Justice
Justice - avatar
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 ?
1st Feb 2023, 1:30 AM
S3R43o3
S3R43o3 - avatar