Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > <> and !=

Reply
Thread Tools

<> and !=

 
 
hokiegal99
Guest
Posts: n/a
 
      07-16-2003
What is the difference between these two statements?

if newfile <> oldfile
if newfile != olfile

Thanks guys!!!

 
Reply With Quote
 
 
 
 
hokiegal99
Guest
Posts: n/a
 
      07-16-2003
Gonšalo Rodrigues wrote:
> On Wed, 16 Jul 2003 08:57:33 -0400, hokiegal99
> <(E-Mail Removed)> 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?

 
Reply With Quote
 
 
 
 
Duncan Booth
Guest
Posts: n/a
 
      07-16-2003
hokiegal99 <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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 http://www.velocityreviews.com/forums/(E-Mail Removed)
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments