On 15/01/16 20:24, Kitten Corner wrote:
Hi, I have python version 3.5.1 and I am working on a project, I'm trying
to make it by using the 'or' sequence, I'm trying to make it do 1 thing or
the other, here's an example: print('i like pie' or 'i like donuts'), it
only does the thing that's before the 'or', please help!

From,
Kitten Corner


Conditional operators (or and not == etc.) need to be used in a test

how else would you expect you print statement to be able to decided which to print?

see if you can work through the code below

food="input food ?"
if food =='pie' or food=='donuts':
        print ('I like %s'%food)
else:
        print ('I dont like %s'%food'

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to