Python Forum
Syntax error when using <> operator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax error when using <> operator
#1
Hello Guys,

I am trying to run this code and each time I am getting an invalid syntax error message, I tried changing the variables, the file name, the program but it always give that error. When I change the operator to > , < or == it works!

Appreciate any help or suggestions.

Thanks :)

a=1
b=2

if a<>b:
    a=b
Reply
#2
Hello! <> is it mean "is not equal to"? It is old syntaxis I think. Try !=
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
This is the second time I have seen this recently. Is there some awful tutorial that is still teaching this or something?
Reply
#4
It was deprecated in Python 2, and I believe it was removed entirely in Python 3. In either case, you definitely shouldn't be using it.
Reply
#5
(Dec-14-2016, 06:51 PM)Mekire Wrote: This is the second time I have seen this recently.  Is there some awful tutorial that is still teaching this or something?

I don't ask anymore. There is, obviously. But I wondering how people run across these!?   Think
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#6
That's definitely possible, but I think it's more likely they're coming from another language or are picking up programming again after having used it years ago.
Reply
#7
Thanks guys, this worked.
@Mekire, the first result in google search for "not equal operator in python" https://www.tutorialspoint.com/python/py...rators.htm
Reply
#8
THanks for looping back! tutorialspoint usually has good stuff, I'm going to try to contact them about that....
Reply
#9
(Dec-14-2016, 07:00 PM)micseydel Wrote: THanks for looping back! tutorialspoint usually has good stuff, I'm going to try to contact them about that....

Yes! I have downloaded half the site. At least  Big Grin
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#10
https://www.tutorialspoint.com/python/index.htm

Quote:For most of the examples given in this tutorial you will find Try it option, so just make use of it and enjoy your learning.

Try following example using Try it option available at the top right corner of the below sample code box −

#!/usr/bin/python

print "Hello, Python!"

Probably all of their stuff is still 2.x
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Syntax error for "root = Tk()" dlwaddel 15 1,007 Jan-29-2024, 12:07 AM
Last Post: dlwaddel
Photo SYNTAX ERROR Yannko 3 333 Jan-19-2024, 01:20 PM
Last Post: rob101
  Syntax error while executing the Python code in Linux DivAsh 8 1,450 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Code is returning the incorrect values. syntax error 007sonic 6 1,135 Jun-19-2023, 03:35 AM
Last Post: 007sonic
  syntax error question - string mgallotti 5 1,248 Feb-03-2023, 05:10 PM
Last Post: mgallotti
  Syntax error? I don't see it KenHorse 4 1,194 Jan-15-2023, 07:49 PM
Last Post: Gribouillis
  Syntax error tibbj001 2 847 Dec-05-2022, 06:38 PM
Last Post: deanhystad
  Python-for-Android:p4a: syntax error in main.py while compiling apk jttolleson 2 1,777 Sep-17-2022, 04:09 AM
Last Post: jttolleson
  Mysql Syntax error in pymysql ilknurg 4 2,287 May-18-2022, 06:50 AM
Last Post: ibreeden
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 1,894 Feb-21-2022, 08:58 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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