Assignment on Dictionary - coordinates

Hi - how do I get the degree to input into Python? I copy pasted the coordinates from source website but when I executed, I got the below error :

pois={
“Mahabalipuram”:12°"N,80°"E"
}

line 2 “Mahabalipuram”:12°"N,80°"E" ^ SyntaxError: invalid character in identifier

The special characters are incorporated using escape sequences. However, I am not sure if there exists one for degree. Do give it a check. Hope this helps!!

I think it’s a matter of keyboard inputs available…

Since you are only using degrees, following code must work

pois={
"Mahabalipuram": "12°N, 80°E"
}

But if you want to include minutes and seconds, then use foll. code

pois={
"Mahabalipuram": "12°37'21\"N, 80°11'38\"E"
}

And if you want to use degrees, min and sec to full accuracy then use

pois={
"Mahabalipuram": "12°37'21.817\"N, 80°11'38.080\"E"
}
1 Like