Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 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 Respostas
+ 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