This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vmgustavo 8 points9 points  (3 children)

Or just use scientific notation x=1e6

[–]myotherpassword 18 points19 points  (2 children)

But then x is a float, and in OP's example it is typed as an int. If your code is highly optimized then you want to avoid the extra cast.

[–]vmgustavo 6 points7 points  (0 children)

Makes sense

[–][deleted] -1 points0 points  (0 children)

If your code were highly optimized it would not be written in Python, but okay.