Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: string to float conversion fails
Post: RE: string to float conversion fails

I found a solution: a = float(input("a = ") or 0) It returns 0 when "enter" is pressed. Thanks to everyone involved to help. **smile**
PetarPetrenko Homework 10 1,268 Feb-29-2024, 01:54 PM
    Thread: string to float conversion fails
Post: RE: string to float conversion fails

(Feb-21-2024, 06:21 PM)DPaul Wrote: (Feb-21-2024, 04:56 PM)PetarPetrenko Wrote: a = float(input("Vnesi ja osnovata a = "))This question/answer excapes me. When I run the above code, I get exactly ...
PetarPetrenko Homework 10 1,268 Feb-22-2024, 11:09 AM
    Thread: string to float conversion fails
Post: RE: string to float conversion fails

(Feb-21-2024, 05:12 PM)deanhystad Wrote: float("0") will return 0 because "0" is a numeric string representing the number 0. "" is not "0", and "" is not a string that represents any number. float...
PetarPetrenko Homework 10 1,268 Feb-21-2024, 05:23 PM
    Thread: string to float conversion fails
Post: string to float conversion fails

Python version: 3.12 Windows 10, x64 This the problematic raw: --------------------------------------------------------------- a = float(input("Vnesi ja osnovata a = ")) ---------------------------...
PetarPetrenko Homework 10 1,268 Feb-21-2024, 04:56 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020