Bottom Page

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
Quote
#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
Quote
#3
This is the second time I have seen this recently. Is there some awful tutorial that is still teaching this or something?
metulburr likes this post
Quote
#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.
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Quote
#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
Quote
#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.
wavic likes this post
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Quote
#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
Quote
#8
THanks for looping back! tutorialspoint usually has good stuff, I'm going to try to contact them about that....
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Quote
#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
Quote
#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
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Syntax error - precedence Rev2k 3 144 Jan-03-2020, 08:36 PM
Last Post: Rev2k
  Keep getting "invalid syntax error" jpringle1 3 271 Dec-25-2019, 04:43 PM
Last Post: Gribouillis
  'invalid syntax' error rix 3 163 Dec-12-2019, 11:14 PM
Last Post: stullis
  Syntax Error (elif statement) Kanashi 0 149 Nov-20-2019, 11:29 PM
Last Post: Kanashi
  Invalid Syntax error mustfirst 9 574 Nov-11-2019, 10:07 AM
Last Post: deep_logic
  Syntax Error megearhart4 2 196 Oct-20-2019, 05:27 PM
Last Post: ichabod801
  kivy - packaging touchtracer syntax error cram 2 239 Oct-14-2019, 08:30 PM
Last Post: cram
  sqlite3.OperationalError: near "%": syntax error Linuxdesire 2 1,061 Oct-13-2019, 02:54 AM
Last Post: Linuxdesire
  def Display Data Invalid Syntax error Linuxdesire 1 234 Oct-11-2019, 05:10 AM
Last Post: stranac
  Syntax Error with Argument Parser aditya_man 1 289 Sep-30-2019, 01:21 PM
Last Post: ichabod801

Forum Jump:


Users browsing this thread: 1 Guest(s)