Project2diploma Cs 5th Semester
Project2diploma Cs 5th Semester
PYTHON
1. What is Python? List some popular applications of
Python in the world of technology.
Ans- It is a high-level, interpreted programing
language, very easy to read and understand. It was
designed by Guido van Rossum and came out in
1991. Code readability has been its most important
feature, with its clear syntax that leaves it no
stranger to either amateur or professional
programmers.
ANS- The Python typeof function is a built-in function that returns the type
of an object. And this function is a polymorphic function, which means it can
take arguments of any type and return a value of any type.
The typeof function is typically used for debugging purposes, to help identify
the type of an object. It can also be used to check the type of the argument
passed to a function. In python, type() is used to get the type of an object.
The type() function allows you to determine the data type of a variable or
parameter. For example, the following code prints "int" when called on the
input "5":
Input
x = 5
print(type(x))
s = 'xyz’
print(type(s))
from collections import OrderedDict
od = OrderedDict()
print(type(od))
class Data:
pass
d = Data()
print(type(d))
Output
<class 'int'>
<class 'str'>
<class 'collections.OrderedDict'>
<class '__main__.Data'>
The type () function returns the type of the object with the module name. But
our Python script doesn’t have a module, so this script module becomes
__main__.