#๐ Problem with Equals to command
29 messages ยท Page 1 of 1 (latest)
@whole zinc
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
cuz you converted it to int
int is not equal to string
oh really?
!e
age = int("34")
print(age == "34")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
False
thats why it goes to else
Oh
Thats weird since on my laptop the script i wrote looks similar to the one i have on here and it allows me to strip the int
no, you can't strip the int. The code you shared shows that your stripping the input (by default returns a string). But after the strip, you've converted it to int. So thats fine so far
Just the if statement is comparing the converted int with a string
So its a logical error
Sorry im new to python
but i can send a picture of my other script
somehow it works
Yes. Notice the difference of your if statement at line 9 here
vs line 8 here
As I said, nothing wrong with the strip
soz for that smol confusion,
np
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.