Focus mode

Veri Bilimi

Stringlerde Casting

Stringlerde Casting

a = "5"
b = "5.3"
int(a)


float(b)


int(b)
---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

<ipython-input-5-07ae29993d50> in <module>
----> 1 int(b)ValueError: invalid literal for int() with base 10: '5.3'
int(float(b))


Comments

You need to enroll in the course to be able to comment!