You can use multiple assignments and ternary operator in your code
Your code will become of 2 lines
print('yes') if a == b or a == c or b == c or b == a or c == a or c == b else print('error')
Arnesh , 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 , an other question:
if a == b or a == c or b == c or b == a or c == a or c == b:
# why checking for < a == b > and also for < b == a >? this is a duplication.
so this code is doing the same but has half the size:
if a == b or a == c or b == c:
Please tell me what you want to improve in it...
a, b, and c are assigned different values.
"or" returns true if one of the statement is true (or both true).
All variables are assigned 1,2,3 which aren't equal. Therefore, it prints "error".
If you will replace any of them which is true like:-
Then, it will print "yes"
Your question is not clear to me.
Are you asking about your question.
I think there's isn't any problem with your code. Ok, so you were asking about mentioning someone in the answer. 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 answered your question. The person whom you mention will be notified when you mention him/her
Narcode Blood gang, please don't ask questions in the question threads of other users.
About your question:
Have you taken a look at our tutorials?
They start easily, and if something's confusing, you'll sure find the solution in the comments or by a search in this forum.
You can also search this forum for beginner advice, there's a lot going around.
you can put them in a set ,since you cant have multiple numbers that are similar in a set,then check for the len of the set if the length of the set is 1 or 2 then print "yes" if it is 3 then print "error"
if len(my_set) < 3:
or you can make it shorter
print("yes") if len(my_set) < 3 else print("ERROR")
Sorry but maybe I have misunderstood the question
All three Numbers must be equal in order to get "yes" or only two of them?
With the "or" statement you can have yes even if one of the three numbers Is different from the others.