B
B
Bitter Sugar2015-05-03 20:40:19
Python
Bitter Sugar, 2015-05-03 20:40:19

How to solve error in Python 2.7 tuple?

Friends, help me figure it out! Refuses to execute the following code:

s = {
    'param': ( (01,09,2005), (u'other') )
    }

actually the error itself:
File "C:/.../test.py", line 130
    'param': ( (01,09,2005), (u'other') )
                    ^
SyntaxError: invalid token

Interestingly, it swears only at the numbers 8 and 9 , everything is done with the rest.
What could be wrong?
Win8 64-bit, PyCharm, Python 2.7 32-bit
-
Thanks everyone! Issue resolved.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kazmiruk, 2015-05-03
@f0xice

Because this is an octal number that starts with 0 in Python, and there are no 8 and 9 in the octal number system.

A
abukhvalov, 2015-05-03
@abukhvalov

First link in google stackoverflow.com/questions/336181/python-invalid-token

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question