I tried this code, but I get a SyntaxError:
if measured_dec =< 0.523966303045:
print "WARNING! Object may be below Horizon!"
What is wrong?
Karl Knechtel
61.5k14 gold badges134 silver badges194 bronze badges
asked Jul 31, 2012 at 14:57
Chris 'Namikaze Kurisu' Fraser
551 gold badge3 silver badges8 bronze badges
4 Answers 4
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!"
Sign up to request clarification or add additional context in comments.
1 Comment
Chris 'Namikaze Kurisu' Fraser
Thanks, I can't believe I missed that
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!"
answered Jul 31, 2012 at 15:00
zellio
32.8k1 gold badge46 silver badges64 bronze badges
1 Comment
Chris 'Namikaze Kurisu' Fraser
Thanks, I can't believe that I missed something so simple
It may be because of "=<"
Try using:
if measured_dec <= 0.523966303045:
print "WARNING! Object may be below Horizon!"
answered Jul 31, 2012 at 15:01
heretolearn
6,5655 gold badges32 silver badges55 bronze badges
1 Comment
Chris 'Namikaze Kurisu' Fraser
Thanks, I can't believe I missed that
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!"
Comments
lang-py