Payton | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Payton

How to set several conditions to if statement in pyton

8th Oct 2019, 5:16 PM
Тесла
Тесла - avatar
13 Answers
0
Simply: if(x<5 and x==2): #what you want to do here
8th Oct 2019, 7:04 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 4
It's Python by the way.
9th Oct 2019, 1:33 AM
Sonic
Sonic - avatar
+ 1
use the actual words' --and, or--' if condition1 and condition2 and condition3 etc: if condition1 or condition2 or condition3: etc.
8th Oct 2019, 5:31 PM
rodwynnejones
rodwynnejones - avatar
0
Use proper tags, and at least write correctly write the name of the language.
8th Oct 2019, 6:14 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
Sorry, I asked a specific question. I am not an Englishman and I am generally -16 and I have English income. And what is not clear, if, statements, a lot?
8th Oct 2019, 6:38 PM
Тесла
Тесла - avatar
0
I don't understand you question, you can try writing it in your native language and wait for someone to answer
8th Oct 2019, 6:43 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
I already did this and no one answered, that's why I wrote in English
8th Oct 2019, 6:48 PM
Тесла
Тесла - avatar
0
Thanks
8th Oct 2019, 6:49 PM
Тесла
Тесла - avatar
0
If you can write in more details what you want I may be able to help
8th Oct 2019, 6:58 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
Here is just an if statement: if x <5: print ("hello"). here is one condition (x <5). but how to make more conditions, for example, so that if x <5 and x == 2 hello is displayed
8th Oct 2019, 7:03 PM
Тесла
Тесла - avatar
0
Ok thank you
8th Oct 2019, 7:05 PM
Тесла
Тесла - avatar
8th Oct 2019, 7:08 PM
Тесла
Тесла - avatar
0
Np
8th Oct 2019, 7:08 PM
Aymane Boukrouh
Aymane Boukrouh - avatar