Python invalid syntax with "if" statement

I tried this code, but I get a SyntaxError:

if measured_dec =< 0.523966303045:
    print "WARNING! Object may be below Horizon!"

What is wrong?

Upvotes: -1

Views: 499

Answers (4)

SkariaArun
SkariaArun

Reputation: 219

The less than or equal to operator is like this '<='. Try it by changing the statement to the following.

if measured_dec =< 0.523966303045:
   print "WARNING! Object may be below Horizon!"

Upvotes: 0

heretolearn
heretolearn

Reputation: 6545

It may be because of "=<"

Try using:

if measured_dec <= 0.523966303045:
    print "WARNING! Object may be below Horizon!"

Upvotes: 0

zellio
zellio

Reputation: 32484

The less-than-or-equal operator goes the other direction. It should be <= not =<

if measured_dec <= 0.523966303045:
    print "WARNING! Object may be below Horizon!"

Upvotes: 0

Andy Creeth
Andy Creeth

Reputation: 106

Your less than or equals operator is the wrong way around, change it to this:

if measured_dec <= 0.523966303045:
    print "WARNING! Object may be below Horizon!"

Upvotes: 2

Related Questions