Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking for equality
#2
it depends if you are running in interactive mode e.g.
>>> car = 'BMW'
>>> car == 'BMW'
True
>>> car == 'Renault'
False
if you are not in interactive mode, you need to print in order to see the result, e.g. in yourfile.py:
car = 'BMW'
print(car == 'BMW')
print(car == 'Renault')
Output:
True False
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Checking for equality - by PythonGainz - Apr-09-2020, 01:44 PM
RE: Checking for equality - by buran - Apr-09-2020, 01:52 PM
RE: Checking for equality - by PythonGainz - Apr-10-2020, 09:59 AM
RE: Checking for equality - by buran - Apr-10-2020, 10:18 AM
RE: Checking for equality - by ndc85430 - Apr-10-2020, 10:20 AM
RE: Checking for equality - by PythonGainz - Apr-10-2020, 10:27 AM
RE: Checking for equality - by PythonGainz - Apr-10-2020, 01:30 PM
RE: Checking for equality - by snippsat - Apr-10-2020, 01:46 PM
RE: Checking for equality - by PythonGainz - Apr-10-2020, 03:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Equality in Python el_bueno 8 3,511 Feb-08-2020, 03:33 PM
Last Post: el_bueno
  Dictionnaries - Equality SupaFlamme 3 2,767 Jan-13-2019, 04:50 PM
Last Post: perfringo
  Problems with Equality of Numbers SheeppOSU 3 2,432 Jan-04-2019, 07:34 AM
Last Post: Gribouillis
  Shared reference and equality zyo 3 3,215 Jun-30-2018, 07:10 PM
Last Post: ljmetzger

Forum Jump:

User Panel Messages

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