Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9025739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:20:59+00:00 2026-06-16T06:20:59+00:00

Why is the minus sign below considered an invalid token? There must be something

  • 0

Why is the minus sign below considered an invalid token? There must be something I do not understand here.

>>> [1e-i for i in range(-10,10)]
SyntaxError: invalid token

Normally these things evaluate like a mother:

>>> 1e-10
1e-10

I’m just curious; I solved my problem with

>>> [10**i for i in range(-10,10)]
[1e-10, 1e-09, 1e-08, 1e-07, 1e-06, 1e-05, 0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:21:00+00:00Added an answer on June 16, 2026 at 6:21 am

    1e-01 etc are numeric literals. They’re seen and tokenized before the script ever runs. And the rules for such a number almost certainly say “an optional (‘E’ or ‘e’, followed by an optional ‘+’ or ‘-‘, followed by digits)”. There’s no provision for variables in that definition, and changing the definition would make it so numeric literals couldn’t be parsed til runtime, which would get very hairy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Aside from Integer.parseInt() handling the minus sign (as documented), are there any other differences
Is there any way to remove the minus sign when in editing mode and
I need an escape sequence for - or the minus sign for php. The
EDIT: Here's a create script for the table minus the constraints on the keys
Hello How can I can I allow only digit [^0-9] and a minus sign
I'm trying to replace values which have a trailing minus sign and replace them
I want to move the minus sign to the right. How do I do
I am removing values from a vector by using - (minus sign) in front
SQL returns codes that are preceded by a minus sign (-) indicate that the
I have a list with a list image of a little plus sign. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.