a = 0.1>>> type(a)<class 'float'>b = -1.2>>> type(b)<class 'float'>c = float()c0.0
>>> float(3)3.0>>> float('5')5.0>>> float('-3.01')-3.01>>> float("hello") #并不是所有的字符串都可以作为参数传递给float()Traceback (most recent call last):File "<stdin>", line 1, in <module>ValueError: could not convert string to float: 'hello'

