Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python input float

Assuming you mean that you are trying to conver the input to float,
you can do

myfloat = float(input("Enter a float: "))

However, do remember that this will return an expection if non-numbers and decimal points
are detected.
Here is a better version

import re
myfloat = float(re.sub("[^0-9.]","",input("Enter a float: ")))

It auto removes any nonnumeric and non decimal point characters.
 
PREVIOUS NEXT
Tagged: #python #input #float
ADD COMMENT
Topic
Name
4+5 =