Why the output shows False instead of True? [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why the output shows False instead of True? [SOLVED]

I attach my code, please see it and please explain me why this happen, I am very confuse it. https://code.sololearn.com/c6morlbuZ3Mw/?ref=app

6th Aug 2023, 9:35 AM
Sakshi
Sakshi - avatar
15 Answers
+ 3
1 ! =1 this condition is false( and) will give true if your both conditions get satisfied
6th Aug 2023, 10:02 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 3
Ok, now I understand it 'if 1 is not equal to 1' in others we say that '1 is not different from 1' second sentence cleared it my confusion, thank you all of you Mirielle mam AS Raghuvanshi and Aayush Suthar bro
6th Aug 2023, 10:39 AM
Sakshi
Sakshi - avatar
+ 3
Mirielle Now, I understand it mam, thank you very much.
6th Aug 2023, 10:40 AM
Sakshi
Sakshi - avatar
+ 2
Mirielle I already know mam when both the conditions are true then the result is true but this question is little bit confusing me, maybe I am wrong but I learn it if arg1!=arg2' then the result will be true but in there condition the result is false why? Idk I am confuse it
6th Aug 2023, 10:28 AM
Sakshi
Sakshi - avatar
+ 1
No bro, I am still confuse it if 1!=1 that means the condition is true, otherwise we directly put it (1==1) If you know hindi : Maine yeh hindi main isliye likha hai ki jis bare main mujhe confusion hai aap woh samje, mera matlab hai ki jab 1 equal nhi hai 1 ke toh (1!=1) toh to iska matlab yeh true hoga na kyonki shi baat hai 1 equal nhi hai 1 ke nhi toh directly likhte (1==1), yhi main english main nhi samjha pa rhi thi 😅
6th Aug 2023, 10:08 AM
Sakshi
Sakshi - avatar
+ 1
The expression 'arg1 != arg2' will output 'true' if the arguments are not equal, if they are equal it will output 'false'. Hence 1 != 1 will be false.
6th Aug 2023, 10:12 AM
Aayush Suthar
+ 1
Aayush Suthar read carefully what you write, you write if arg1!=arg2' then it output shows 'true' if the arguments are not equal, if they are equal then it will output 'false' Modified your comment: if arg1!=arg2' then it output shows 'false' if the arguments are not equal, if they are equal then it will output 'true', don't get confuse. My question is why 1!=1 print false instead of true?
6th Aug 2023, 10:25 AM
Sakshi
Sakshi - avatar
+ 1
FALSE and TRUE =FALSE if any one condition is false then it gives false That's why you should take both the value is true 1==1and 2==2
7th Aug 2023, 9:56 AM
Raj Ratan Gupta
Raj Ratan Gupta - avatar
+ 1
1!=1 false hoga didi. Kyoki 1==1 true hota hai...Baki aap aage jaanti hi hogi ki aage kaise solve hota hai...
1st Jan 2024, 11:29 AM
Pralhad
Pralhad - avatar
0
FALSE and TRUE =FALSE if any one condition is false then it gives false That's why you should take both the value is true 1==1and 2==2
6th Aug 2023, 2:28 PM
Abhimanu Pandey XI.D
Abhimanu Pandey XI.D - avatar
0
1!=1 -> False (Cuz 1 is actually equal to itself) 2==2 -> True False and True -> False ("and" checks if both conditions are True, but since there is 1 False in the statement, it would output False `1!=1 and 2==2 -> False`) False or True -> True ("or" checks if ONE OF the conditions are True, but since there is 1 True in the statement, it would output True `1!=1 or 2==2 -> True`)
7th Aug 2023, 8:00 AM
Dragon RB
Dragon RB - avatar
0
Hey guys, I m struggling with my assignment, need help. Python
7th Aug 2023, 10:01 AM
jonathan mgadi
jonathan mgadi - avatar
0
Here 1 is equl to 1 where given 1 is not equal to 1 that is false. Now one false and one true become false thats why result is showing false
7th Aug 2023, 4:12 PM
Eaz Mahodi Sagor
Eaz Mahodi Sagor - avatar
0
عع
7th Aug 2023, 9:16 PM
ساحر الظلام
ساحر الظلام - avatar
0
Sakshi , I wrote a True False table for studying and a True False quiz for practicing in Python. https://code.sololearn.com/c3H66O1ff1gm/?ref=app https://code.sololearn.com/cmRJlrpqDTfh/?ref=app
18th Sep 2023, 11:27 PM
Rain
Rain - avatar