Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 7 Online
OpenStudy (anonymous):

Mit6.189 Handout 1 optional ex 1. I am doing the zeller.py (optional question) and i have a problem. Whenever i enter 08 or 09 for the year it says Desktop/Python/Mechanical Mooc/HomeWork/6.189/Handout 1/zellers.py", line 11, in c = input ("Year of the century e.g. 79 for the year 1979 ") File "", line 1 09 ^ SyntaxError: invalid token what is wrong?

OpenStudy (anonymous):

It would appear its an octal (?) I was using input to get an int. To remedy this i needed to use raw_input to get the result I required.

OpenStudy (anonymous):

@jtb1979 can you post a link to your code? a lot of people use services like these: https://gist.github.com/ http://pastebin.com/

OpenStudy (anonymous):

Here is my code..... http://pastebin.com/9qsYZDvb I thought I had cracked it but maybe not.

OpenStudy (anonymous):

Well after a bit of research I have discovered an answer. When I enter the dates i need to input them as a string otherwise it will recognize 08 / 09 as an octal which will crash the program. And then before I use them in any calculations i need to convert them into strings. It seems to work fine.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!