If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
predefined function type() का python में variables का type जानने के लिए किया जाता है।
type(object)
object | required : function में pass किया गया argument है जिसका type के बारे में पता करना है , यह argument required होता है।
print( type("String") ) #string.
print( type(2) ) #int.
print( type(4.6) ) # float.
print( type((23,34)) ) #tuple.
print( type({23,34}) ) #set.
print( type([23,34]) ) #list.
print( type({"name":"rahul", "age":23}) ) #dictionary.
C:\Users\Rahulkumar\Desktop\python>python checkType.py <class 'str'> <class 'int'> <class 'float'> <class 'tuple'> <class 'set'> <class 'list'> <class 'dict'>
Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook