I have a question
maybe you guys try it out but I am having trouble:
When I run it the beginning works perfectly but when I ask the last question it does not respond. I was wondering if there was an answer to this.
https://repl.it/@miloplotitsa/no
for a non link version:
message = ('wait, you just said')
print ('hello')
#not sure what to do with this
first = input ('A, E, __, O, U, and sometimes Y')
second = input('what is the color of the sky and the ocean?')
third = input('what is the opposite of down?')
print (message+first+second+third+'!')
print ('I\'m sorry that\'s just stupid')
print ('I said I am sorry a\'ight?')
friend = input('im sorry okay? can we please be friends?')
if friend == ('yes' or 'y'):
print ('yay!')
Voters
mkhoi (202)
I tested it... Its works totally fine 🤷♂️
ash15khng (472)
For the last question what input are you giving it? If you don't give yes or y nothing gets printed.
The problem is that
or
is usually used to compare two boolean expressions, which means the 2 things on its left and write must have a value of eitherTrue
orFalse
.In this case the two things you're asking
or
to check are'yes'
'y'
That doesn't make much sense, what you're really trying to do is
friend == 'yes'
friend == 'y'
So what you should have written is
A slightly better way of writing the same thing is
Your code now works like a charm :)