Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

ValueError: could not convert string to float

Occurs when converting a non-numeric string to float.

Reproduce

value = "abc"
number = float(value)
print(number)

Error Message

ValueError: could not convert string to float: 'abc'

Fix

value = "3.14"
number = float(value)
print(number)

Reflection

Tried converting a string that wasn't a number.