+ 3
I typed a="rishabh", b="rishabh" & print("a" == "b"). I found output false why?
18 odpowiedzi
+ 23
With "a" == "b" you test if "a" and "b" are the same letters. They are not, so the output is False. Remove the quotes to check if the contents of the variables are equal.
+ 4
Jeet he is probably using python that's why he is using print instead of printf
+ 3
You are giving wrong input so that the output is false. Remove the quotes of a and b
+ 3
The same answer has been given seven times in a row now. I think OP got it by now
+ 3
REGINA MUTUA But what is OP supposed to do with the quotes? Can he just keep them or do you think that removing them would be a better idea?
+ 3
Jeet haldar That's why it's probably not a good idea to learn five languages at the same time 🤔
+ 2
Remove the quotes of and b
+ 2
"a" and "b" are clearly not the same character
+ 2
Remove the inverted commas from both "a", "b" you will definetly get the desired output ie 1
+ 1
Remove the quotes of a n b
+ 1
Quotes are the problem
+ 1
Тут русски кто нибудь знает
+ 1
a and b are different characters so equalizing them makes the output false, precisely remove the quotes
+ 1
Bhai sunn woh 2 bindu hataley dodega programme
+ 1
a="rishabh" means you are assigning the string to a variable a. To check variable a is equal to variable b you should try a==b."a"=="b" means it checks if string a is equal to string b which is false and thereby gives error.
0
One more thing you wrote print not printf
0
Anna sorry but I am learning them one by one not at the same time
0
There you comapre "a" with "b" which becames char values
Not the variables a and b
Thats why it prints false
Write it as print(a==b).