D
D
Dream2021-06-19 23:29:55
Python
Dream, 2021-06-19 23:29:55

How to get data from user float?

We need to receive data from the user by type: amount:int , but only a floating point number.
Example: 1.2, 1.20, 1.25 etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stefan, 2021-06-19
@dreameddd

x = input()
x = float(x)

or describe in more detail what you wanted, where to get the data from, what amount:intis type-hint?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question