On 15/02/17 04:43, eryk sun wrote:
>> value = 1e5 # or 3e7 or whatever...
>
> 10**5 is an int and 1e5 is a float.
Good point, I'd forgotten about that distinction.
> Replacing 10**5 with 10 is a compile-time optimization
And didn't know about that one.
Thanks for the clarification.
--
On Tue, Feb 14, 2017 at 11:01 PM, Alan Gauld via Tutor wrote:
> To compute it if you don't know x in advance then yes,
> use something like
>
> value = 10**x
>
> But if you know the value in advance you can write it in
> a more compact form as:
>
> value = 1e5 # or 3e7 or whatever...
10**5 is an
On 14/02/17 12:03, Aaliyah Ebrahim wrote:
> For the function 1*10^x, is there a specific way of computing *10^x or will
> it just be the following :
>
> 1*10**x
To compute it if you don't know x in advance then yes,
use something like
value = 10**x
But if you know the value in advance you can
Hi
For the function 1*10^x, is there a specific way of computing *10^x or will
it just be the following :
1*10**x
Thank you.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo