Can you help me? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Can you help me?

how to use "or" statement with "if" !! I want the script to be something like this:- x = me inp = input (' ') if inp == ('this'') or ('that'): print (x)

5th Jul 2017, 12:53 PM
JULIAN ANTHONY
JULIAN ANTHONY - avatar
7 Answers
0
Sorry you added jQuery in the tags. But the syntax are very close. In Python you can use if inp == ('this') or inp == ('that').
5th Jul 2017, 1:18 PM
Bumpety
+ 1
if (inp == ('this') || inp == ('that')) {} If you want to use more then on condition in the ( ), you can use the || (or) and && (and).
5th Jul 2017, 1:03 PM
Bumpety
+ 1
By the way thanks for the help. looks like I used the correct code in my question
5th Jul 2017, 1:25 PM
JULIAN ANTHONY
JULIAN ANTHONY - avatar
0
is this for python ???
5th Jul 2017, 1:09 PM
JULIAN ANTHONY
JULIAN ANTHONY - avatar
0
Nope, this is for jQuery.
5th Jul 2017, 1:12 PM
Bumpety
0
sorry but I need for python scripting !!
5th Jul 2017, 1:13 PM
JULIAN ANTHONY
JULIAN ANTHONY - avatar
- 1
lol I never added JQUERY in the tags.
5th Jul 2017, 1:21 PM
JULIAN ANTHONY
JULIAN ANTHONY - avatar