Error in or

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Jun 11 13:54:55 EDT 2015


On 11/06/2015 17:39, subhabrata.banerji at gmail.com wrote:
> On Thursday, June 11, 2015 at 9:20:59 PM UTC+5:30, Ian wrote:
>> On Thu, Jun 11, 2015 at 9:40 AM,
>>>    if write this it is working fine, but if I write
>>>
>>>    if ("AND" in inp1) or ("OR" in inp1) or ("NOT" in inp1) or (">" in inp1) or ("&" in inp1) or ("MAYBE" in inp1) or ("(" in inp1) or ("*" in inp1) or (''' " ''' in   inp1):
>>>
>>>   the portion of (''' " ''' in   inp1) is not working.
>>
>> Not working how? I copy-pasted the line and it appears to work fine.
>
> Dear Sir,
> Thank you for your kind reply. Nice to know your reply, but I am trying to send you my experiment, please see my results,
>
>>>> def input1(n):
> 	inp1=raw_input("PRINT YOUR QUERY:")
> 	if ("AND" in inp1) or ("OR" in inp1) or ("NOT" in inp1) or (">" in inp1) or ("&" in inp1) or ("MAYBE" in inp1) or ("(" in inp1) or ("*" in inp1) or (''' " ''' in   inp1):
> 		print "FINE"
>
> 		
>>>> input1(1)
> PRINT YOUR QUERY:"Java"
>>>> input1(1)
> PRINT YOUR QUERY:"Obama in London"
>>>> input1(1)
> PRINT YOUR QUERY:Obama AND Bush
> FINE
>>>> input1(1)
> PRINT YOUR QUERY:Obama OR Bush
> FINE
>>>>
>
> you may get better my problem.
>
> Regards,
> Subhabrata Banerjee.
>

In [6]: input1(1)
PRINT YOUR QUERY:Bush ANDES Obama
FINE

In [8]: input1(1)
PRINT YOUR QUERY:Bush ORDER Obama
FINE

Do you actually want this?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list