+ 5

i am not able to understand how to use or & and

22nd Jun 2018, 8:26 AM
inayat deshmukh
inayat deshmukh - avatar
17 Respuestas
+ 22
&& using oprator you chek multiple condition and print the value if eather condition is true for example int java=15; int python=15; int php=20; int c#=20; if(java==python&&php==c#) /* print the value if eather condition is true*/ print(true);
24th Jun 2018, 8:14 AM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 21
yes you right😉😉😉
24th Jun 2018, 8:17 AM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 21
but this is for example
24th Jun 2018, 8:18 AM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 6
ihateonions Good example!
22nd Jun 2018, 8:57 AM
Rex
Rex - avatar
+ 4
Example of the && boolean... i = 5 li = 10 if i == 5 && li == 10: print "i is 5 and li is 10"; Now, it outputs i = 5 li = 10
22nd Jun 2018, 8:52 AM
Rex
Rex - avatar
+ 4
if (something1 == 'val1' and something2 == 'val2' and something3 == 'val3' and something4 == 'val4'): This can get a little messy tho so try and clean it up to the below if something1 == 'val1' and \ something2 == 'val2' and \ something3 == 'val3' and \ something4 == 'val4': To use OR statements use if (something1 == "hello" and "hello1") or "goodbye"
22nd Jun 2018, 8:55 AM
ihateonions
+ 3
Hello inayat deshmukh Good Morning, can you brief us what you want done.. In what language are you finding this problem?
22nd Jun 2018, 8:43 AM
Rex
Rex - avatar
+ 3
Okay let's help you out here
22nd Jun 2018, 8:49 AM
Rex
Rex - avatar
+ 1
ok
22nd Jun 2018, 8:52 AM
inayat deshmukh
inayat deshmukh - avatar
+ 1
thanks I understood it
22nd Jun 2018, 11:19 AM
inayat deshmukh
inayat deshmukh - avatar
+ 1
ok thanks
24th Jun 2018, 8:18 AM
inayat deshmukh
inayat deshmukh - avatar
+ 1
after all we are all indian tigers
24th Jun 2018, 8:18 AM
inayat deshmukh
inayat deshmukh - avatar
0
22nd Jun 2018, 8:45 AM
inayat deshmukh
inayat deshmukh - avatar
0
22nd Jun 2018, 8:45 AM
inayat deshmukh
inayat deshmukh - avatar
0
can you please give me some example with proper description
22nd Jun 2018, 8:46 AM
inayat deshmukh
inayat deshmukh - avatar
0
but in that code you forgot to put statement in {}
24th Jun 2018, 8:16 AM
inayat deshmukh
inayat deshmukh - avatar
0
am i right ?
24th Jun 2018, 8:16 AM
inayat deshmukh
inayat deshmukh - avatar