Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję0
I'm confused about the equal operator,about assignment being one equal sign and comparison being two equal sign
One equal sign = Two equal sign ==
2 odpowiedzi
+ 4
This = is used to assign a value to a variable while == known as the equality operator is used to check if value a == value b.
Examples
1.
a = 4 # assined a value to variable a
print(a)#it prints 4 to the console
2.
a = 4#4 has been assigned to variable a
b = 5#5 has been assigned to variable b
print(a==b)#it will print false because variable a is not the same as variable b
+ 1
MATOVU CALEB oohhh..I get it now
Thanks