<> and !=

H

hokiegal99

What is the difference between these two statements?

if newfile <> oldfile
if newfile != olfile

Thanks guys!!!
 
H

hokiegal99

Gonçalo Rodrigues said:
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?
 
D

Duncan Booth

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top