[issue39476] Not convinced with the dynamic data type assignment

Sushma report at bugs.python.org
Tue Jan 28 23:44:56 EST 2020


Sushma <sush0907 at gmail.com> added the comment:

Thank you

On Tue, Jan 28, 2020, 6:30 PM Steven D'Aprano <report at bugs.python.org>
wrote:

>
> Steven D'Aprano <steve+python at pearwood.info> added the comment:
>
> The "num" variable is not a number, it *is* a string. Just because you
> call it "num" doesn't magically turn it into a number. The `input` function
> returns a string.
>
> You might be thinking of Python 2.7 where `input` automatically evaluated
> the string as Python code. Python 3 does not do that. If you want to
> convert the string result of `input` to be a float or an int or some other
> type, you need to call the `float` or `int` functions.
>
> ----------
> nosy: +steven.daprano
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue39476>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39476>
_______________________________________


More information about the Python-bugs-list mailing list