H
H
HusniddinEshmuhammatov2018-11-12 13:37:48
Python
HusniddinEshmuhammatov, 2018-11-12 13:37:48

How to enter decimal numbers in Python?

Hello. Here is an excerpt from the program code

@app.route('/result', methods=['POST'])
def result():
    var_1 = request.form.get("var_1", type=float)
    var_2 = request.form.get("var_2", type=float)

   operation = request.form.get("operation")
    operation2 = request.form.get("operation2")
    operation3 = request.form.get("operation3")

    if(operation == u'Q (теплота в Дж)' and operation2 == u"q (Электрический заряд в Кл)" and operation3 == u"C (емкость в фарад)"):
        result=(var_1**2) / (2*var_2)
the thing is that I can only enter numbers with a comma, but I also need to enter numbers with a degree, for example 10^-10, but when I enter it, it gives an error, are there data types for such numbers? if int for integers, float for numbers with comma?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question