+ 5
i am not able to understand how to use or & and
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);
+ 21
yes you right😉😉😉
+ 21
but this is for example
+ 6
ihateonions Good example!
+ 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
+ 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"
+ 3
Hello inayat deshmukh Good Morning, can you brief us what you want done.. In what language are you finding this problem?
+ 3
Okay let's help you out here
+ 1
ok
+ 1
thanks I understood it
+ 1
ok thanks
+ 1
after all we are all indian tigers
0
in python
0
in python
0
can you please give me some example with proper description
0
but in that code you forgot to put statement in {}
0
am i right ?