On Sunday May 2 2010 22:44:42 David Hutto wrote: > Q1 and Q2 are to be entered as base ten scientific notation. > When I try to input Q1 as raw input, entering in ((2*(10**7)), I get: > > ValueError: invalid literal for int() with base 10: '((2)*(10**7))' > > Which is why I broke it down into it's sub-components(i.e. what to > multiply the base 10 by[Q1mult] and what exponent to use with the base > 10[Q1exp]). > > Is there a better way to write this, and what would be the best way to > insert the > scientific notation if not this way.
Maybe this is what you are looking for: In [1]: 1e9 Out[1]: 1000000000.0 In [2]: float(raw_input()) 1e9 Out[2]: 1000000000.0 Eike. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor