Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialReign Anu
1,537 PointsConfusion over term
Though I know this has been covered before, whats the difference between "==" and "="?
1 Answer
Kieren Hughes
2,851 Points== is a comparison operator, whereas = is used for assignment.
For example:
a = 5 will assign the value 5 to the variable a.
2 == 3 will return False as 2 is not equal to 3
2 == 2 will return True
Hope that helps!
Reign Anu
1,537 PointsReign Anu
1,537 PointsThank you so much!!!
Grigorij Schleifer
10,365 PointsGrigorij Schleifer
10,365 PointsHey Reign,
see this code example as additional information.
Grigorij