About 81,200 results
Open links in new tab
  1. How to make python read input as a float? - Stack Overflow

    May 1, 2021 · The problem I run into is that python does the division indicated by backslash and since the two numbers are integers, the result is 0. Even if I convert my input into a float the …

  2. python - entering int or float using input () - Stack Overflow

    Apr 7, 2022 · Python input processing when input is a float or string. 0. Python during runtime does not consider a ...

  3. python - How do you take a users input as a float? - Stack Overflow

    File "C:\Users\Jarrall\Desktop\store\script.py", line 5, in <module> inventory[item] = float(raw_input('Price: ')) ValueError: could not convert string to float: What must I change …

  4. python - How do i convert user input to a float or int ... - Stack …

    Oct 4, 2022 · But print always returns None - you've lost the input. Assign the variable and print in different steps. But don't forget to manage errors. Users are notoriously bad at following …

  5. python - How to check if a user input is a float - Stack Overflow

    Apr 26, 2014 · I'm doing Learn Python the Hard Way exercise 35. Below is the original code, and we're asked to change it so it can accept numbers that don't have just 0 and 1 in them. def …

  6. python - Python3 input () floats list - Stack Overflow

    May 23, 2014 · It doesn't coerce the str to a list (Python is strongly-typed, and doesn't implicitly coerce); it iterates over it. The problem here is that iterating over a string is done character-by …

  7. python - Using isdigit for floats? - Stack Overflow

    Python input processing when input is a float or string. 0. Casting User-Provided Numbers to Integers and ...

  8. Int or float of an input function in Python - Stack Overflow

    Jul 16, 2021 · It's likely that your instructor was using Python 2, which would automatically deduce and convert the type of the result of input. This was changed in Python 3. – 0x5453

  9. python - How to input several float variables at once - Stack …

    Feb 26, 2017 · How to make python read input as a float? 0. Taking multiple inputs in python. 0.

  10. How to accept both integer and float values as input?

    this is how you could check the given string and accept int or float (and also cast to it; nb will be an int or a float):

Refresh