Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assignment operator
#3
I'm not sure what you mean by arithmetic operator. The assignment operator (=) is often confused with the comparison operator (==), however.

>>> breakfast = 'spam'   # assigns a value to the breakfast variable
>>> breakfast            # show that value
'spam'
>>> breakfast == 'eggs'  # compares the breakfast variable to another value.
False
>>> breakfast == 'spam'
True
The assignment operator is for storing values in variables. The comparison operator is usually used in conditionals (if/elif) and while loops.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Assignment operator - by DavidTheGrockle - Aug-08-2019, 08:47 PM
RE: Assignment operator - by jefsummers - Aug-08-2019, 08:57 PM
RE: Assignment operator - by ichabod801 - Aug-08-2019, 09:00 PM
RE: Assignment operator - by DeaD_EyE - Aug-09-2019, 01:00 AM
RE: Assignment operator - by DavidTheGrockle - Aug-10-2019, 08:05 PM
RE: Assignment operator - by perfringo - Aug-10-2019, 10:48 PM
RE: Assignment operator - by ichabod801 - Aug-10-2019, 08:13 PM
RE: Assignment operator - by ThomasL - Aug-11-2019, 07:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  assignment: not an operator nor expression, but x=y=z=3 works fine? jefdaels 1 2,250 Jan-29-2019, 02:19 PM
Last Post: perfringo
  How many variables/values are limited to single assignment operator? Prabakaran141 1 2,084 Sep-06-2018, 03:32 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020