how do you compare variables for ex ample you have variables a and b you want to compare them and see if they are the same | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

how do you compare variables for ex ample you have variables a and b you want to compare them and see if they are the same

on python

12th Oct 2017, 10:37 PM
FISHARM
8 Answers
13th Oct 2017, 12:04 AM
jay
jay - avatar
+ 4
for compare : a == b and for type compare : type(a) == type(b)
12th Oct 2017, 10:58 PM
Ali Tavana
Ali Tavana - avatar
+ 2
yes
13th Oct 2017, 12:45 AM
FISHARM
+ 1
it didnt work
12th Oct 2017, 11:16 PM
FISHARM
+ 1
if a==b print ("yay")
12th Oct 2017, 11:31 PM
FISHARM
+ 1
variables
12th Oct 2017, 11:40 PM
FISHARM
+ 1
my answers to a question a is an answer f is also an answer
13th Oct 2017, 12:01 AM
FISHARM