By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

Why does print 038 produce an invalid token error.

P: 1
Please give me an example why print 038 returns an invalid token error.
Feb 10 '11 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
Only digits 0..7 are valid for octal numbers. See Python documentation.

Here's an example:
Expand|Select|Wrap|Line Numbers
  1. >>> 0377
  2. 255
  3. >>> 0378
  4. Traceback (  File "<interactive input>", line 1
  5.     0378
  6.        ^
  7. SyntaxError: invalid token
  8. >>> 
Feb 10 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.