Python tipe() Funksie
Voorbeeld
Gee die tipe van hierdie voorwerpe terug:
a = ('apple', 'banana', 'cherry')
b = "Hello World"
c = 33
x =
type(a)
y = type(b)
z = type(c)
Definisie en gebruik
Die type()
funksie gee die tipe van die gespesifiseerde voorwerp terug
Sintaksis
type(object,
bases, dict)
Parameterwaardes
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 |