[Python 3.X] / Python'da Veri Tipini Sorgulama / type() fonksiyonu

(13.10.2017 tarihinde oluşturuldu.)

Python'da bir verinin hangi tipte olduğu öğrenmek type fonksiyonu ile oldukça basit.
type() fonksiyonu parantez içerisine yazdığının verinin türünün ne olduğu bilgisini size döndürecektir.

Örnek 1
>>> a=5
>>> type(a)
(class 'int')


Örnek 2
>>> isim="Selçuk Sinan KIRAT"
>>> type(isim)
(class 'str')


YORUMLAR (0 yorum)



Yorum Gönder
CAPTCHA