Hi, I am trying to practice a little and I came across this question which I am finding hard to do. I am still a beginner in Python so I appreciate some help and sorry if my English is not that good, it's not my primary language.
The question is as follows:
Create a function which can replace the input function and returns a float value. If the user enters anything else besides digits and a decimal point, the input is rejected and the process loops.
To check for digits and decimal points, you can create another function which returns TRUE if the string contains only number and a decimal point, and FALSE if other characters are present.
Comment
Hi, I am trying to practice a little and I came across this question which I am finding hard to do.
I am still a beginner in Python so I appreciate some help and sorry if my English is not that good, it's not my primary language.
The question is as follows:
Create a function which can replace the input function and returns a float value.
If the user enters anything else besides digits and a decimal point, the input is rejected and the process loops.
To check for digits and decimal points, you can create another function which returns TRUE if the string contains only number and a decimal point, and FALSE if other characters are present.
Thank you!