Python Tutorial 31 - Type Casting using int() float() and str()

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

it has been 9 years ago and now i am watching this video. so helpful nowadays, thanks (:

jafierz
Автор

Really helped with my exam revision for ICT cheers mate x

faithcunningham
Автор

@woodytoob. Here is an example of a Python cast ... cast(cStringVariable, c_char_p).value.decode("ascii") which casts a C style string to a Python style string.

eddyquick
Автор

in(5.5)
output 5
THis would be an example of casting am I right?

priya
Автор

But my thing is why do you want to convert it to a number if it's already a number in the first place? I only use string as a text, I don't use number a text. If I want to use a number as a string, I would type it out word by word.

iluvuvibez
Автор

Erro: Could not convert string to float :, How to solve this error?,
self.totalcp = float(self.cp * self.estoque) self.totalsp = float(self.sp * self.estoque) self.lucro = float(self.sp - self.cp)

I'm from Brazil

lucaspereira