Hi guys,
I have a simple question for you. Why the "input" function reads always the user input like a string? could not be it a problem?
right now I'm writing a simple script, but before to start, it must check if the user input is a number (int/float) or not. if the user input is a number it's ok, the script can start, otherwise it can't go ahead. How can I do that if Python read all the user inputs like a string? what is the discriminating factor to understand if the user input is a number or not?
p.s.:
I'm not an English speaker and I don't know very well Python, I'm still studying. Currently I'm reading the free book "Think in Python" by Allen B. Downey. I read just the first five chapters.
just to inform you, I'm using Python 3.6.6 in Linux Mint 19 Cinnamon.
I have a simple question for you. Why the "input" function reads always the user input like a string? could not be it a problem?
right now I'm writing a simple script, but before to start, it must check if the user input is a number (int/float) or not. if the user input is a number it's ok, the script can start, otherwise it can't go ahead. How can I do that if Python read all the user inputs like a string? what is the discriminating factor to understand if the user input is a number or not?
p.s.:
I'm not an English speaker and I don't know very well Python, I'm still studying. Currently I'm reading the free book "Think in Python" by Allen B. Downey. I read just the first five chapters.
just to inform you, I'm using Python 3.6.6 in Linux Mint 19 Cinnamon.