I wanted to make something by myself, so I made it like this and entered the weather information in weather.txt, but the if statement does not respond to the weather I entered in the document What's the problem?python
I don't know what the weather.txt file is like.
If the file looks like this,
You must attach the opening letter
if contents == 'Rain\n' or contents == 'Eye\n':
If you want to use it universally, use
if contents.find('rain')!=-1 or contents.find('eye')!=-1:
Write it like this
© 2022 pinfo. All rights reserved.