<> and !=

Discussion in 'Python' started by hokiegal99, Jul 16, 2003.

  1. hokiegal99

    hokiegal99 Guest

    What is the difference between these two statements?

    if newfile <> oldfile
    if newfile != olfile

    Thanks guys!!!
     
    hokiegal99, Jul 16, 2003
    #1
    1. Advertising

  2. hokiegal99

    hokiegal99 Guest

    Gonçalo Rodrigues wrote:
    > On Wed, 16 Jul 2003 08:57:33 -0400, hokiegal99
    > <> wrote:
    >
    >
    >>that sould be:
    >>
    >>if newfile <> oldfile
    >>if newfile != oldfile

    >
    >
    > No difference whatsoever. I believe != is prefered (style guide?)
    > though -- and that's the one I always use.
    >
    > With my best regards,
    > G. Rodrigues


    Thank you, that is what I thought. What's the reason for having two
    symbols mean the same thing?
     
    hokiegal99, Jul 16, 2003
    #2
    1. Advertising

  3. hokiegal99

    Duncan Booth Guest

    hokiegal99 <> wrote in
    news::

    > Thank you, that is what I thought. What's the reason for having two
    > symbols mean the same thing?
    >

    Originally Python only had '<>' for the not-equal comparison. Version 0.9.3
    added a bunch of C like syntax, such as C's shifting and masking operators.
    It also added C style '==' and '!=' comparison operators. The original '<>'
    remains valid for backwards compatibility.

    --
    Duncan Booth
    int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
    "\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
     
    Duncan Booth, Jul 16, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nut Cracker
    Replies:
    1
    Views:
    349
  2. jakk
    Replies:
    4
    Views:
    12,390
  3. Tim Meagher
    Replies:
    8
    Views:
    1,300
    Karl Seguin
    Jun 18, 2005
  4. Jerry Manner
    Replies:
    2
    Views:
    6,587
    SpaceGirl
    May 30, 2005
  5. titi

    if and and vs if and,and

    titi, Mar 9, 2007, in forum: VHDL
    Replies:
    4
    Views:
    601
    Mike Treseler
    Mar 11, 2007
Loading...

Share This Page