Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

Here's my python code. Could someone show me what's wrong with it.

while 1: 

date=input("Example: March 21 | What is the date? ") 

if date=="June 21":

  sd="23.5° North Latitude" 

if date=="March 21" | date=="September 21": 

  sd="0° Latitude" 

if date=="December 21":

  sd="23.5° South Latitude"

if sd: 

  print sd

And Here's what happens:

>>> 

Example: March 21 | What is the date? 

Traceback (most recent call last): 

File "C:\Users\Daniel\Desktop\Solar Declination Calculater.py", line 2, in <module> 

  date=input("Example: March 21 | What is the date? ")

File "<string>", line 0 

SyntaxError: unexpected EOF while parsing

>>>

1 Answer

0 votes
by (106k points)

From your code, it looks like you are using Python 2.0 version so you should use raw_input instead of input.

Related questions

0 votes
0 answers
asked Dec 31, 2020 in Python by shashu (120 points)
0 votes
0 answers
+1 vote
3 answers
asked Oct 3, 2019 in Python by Sammy (47.6k points)

Browse Categories

...