Python အမျိုးအစား() လုပ်ဆောင်ချက်
ဥပမာ
ဤအရာဝတ္ထုများ၏ အမျိုးအစားကို ပြန်ပေးပါ-
a = ('apple', 'banana', 'cherry')
b = "Hello World"
c = 33
x =
type(a)
y = type(b)
z = type(c)
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
type()
လုပ်ဆောင်ချက်သည် သတ်မှတ်ထားသော အရာဝတ္ထုအမျိုးအစားကို ပြန်ပေးသည် ။
အထားအသို
type(object,
bases, dict)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
object | Required. If only one parameter is specified, the type() function returns the type of this object |
bases | Optional. Specifies the base classes |
dict | Optional. Specifies the namespace with the definition for the class |