+ 1
Halp
So I made a sentence generator it works fine btw and I want there to be a right answer that comes with the output as true if not the right combination of words the output is false but if it guesses right it wonât say true Iâm using this .... If choices == str(âyo m8 wassupâ): Print(True) elif choices is not == str(âyo m8 wassupâ) Print(False)
2 Answers
+ 6
This works better and is more readable:
if choices == "yo m8 wazzup":
print(True)
else:
print(False)
In case you're wondering, if you *really* wanted to use an elif (there is no need, though), you should do:
if choices == "yo m8 wazzup":
print(True)
elif choices != "yo m8 wazzup":
print(False)
But actually, you could achieve the same in one line:
print(choices == "yo m8 wazzup")
+ 2
ty man ill give it a try