Python Notes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Introduction to Python

Python is known as an interpreted scripting language. Gudo van Rossum designed it.

It was released in the year 1991. The different versions were released for Python like

python 1, python 2, and python 3. It is one of the most used scripting languages for

automating the modules and tools, development of web applications, handling big

data, complex calculations, workflow creation, rapid prototyping, and other software

development purposes.

Main Components of Python


Given below are the main components/highlights of Python:

 Functions: In Python, there are inbuilt functions that help in retrieving or

returning the actual value. For example, Mathematical functions. It is the

collection of blocks that can be run at any time where the programmers want or

required the functionality.

 Classes: In Python, it defines the structure of variable and statement that needs

to execute and in classes functions are also defined to execute.

 Modules: In Python, it groups the functions and classes. It is used for string

manipulation, character manipulation, web programming, and graphics

programming.
 Packages: In Python, packages are used to run the set of instructions,

importing of libraries, etc.

Characteristics of Python
Given below are the characteristics mentioned:

 Platform independent: Python is platform-independent. The python code can

be used for any operating system like Windows, Unix, Linux, and Mac. There

is no need to write different codes for different OS.

 Interpreted: The python code does not need to compile as required for other

languages. Python code automatically converts the source code into byte code

internally, and the code is executed line by line, not at once, so it takes more

time to execute the code for the application.

 Simple: The Python language is simple that can be easily coded and read. The

syntax of python is really simple and can be learned easily.

 Robust: Python is robust.

 High-level language: It is a high-level language used for scripting. It means

one does not need to remember the system architecture and no need to manage

the memory.

 Rich library support: Python can be integrated with other libraries that help in

making the functionality work for you. You do not need to write the extra code

for that.
 Embeddable: Python source code can be put into a different language to use.

This helps in integrating the functionality of the python program with other

languages.

 Open-source: Python is open source and readily available over the internet

anywhere. One does not need to take the license of it. It can be easily

downloaded and use.

 Free of cost: It is free of cost. Programmers or Organization does not need to

put the extra cost to use this and reduce the cost to the user.

 Concise and compact: Python code is mainly concise and compact, which

helps the programmers to understand it clearly.

 Dynamically typed: It is dynamically typed, which means that the type of

value will be decided at run time. This is the reason why the programmers

don’t declare the type of variable earlier.

Applications Based on Python


Given below are the applications mentioned:

 Web applications

 Web frameworks

 Software development

 Graphic user interface applications

 Prototyping
 Operating Systems

 Applications (Business and Enterprise)

There are some organizations that are using python at a higher level:

 Microsoft

 Google

 Yahoo

 YouTube

 Mozilla

 DropBox

 Cisco

 Spotify

 Facebook

 OpenStack

Advantages and Disadvantages of Python


Given below are the advantages and disadvantages mentioned:

Advantages:
 It is open-source and readily available to use.

 It is easy to learn and explore.

 Third-party modules can be easily integrated.


 It is high level and object-oriented programming language.

 It is interactive and portable.

 Applications can be run on any platform.

 It is a dynamically typed language.

 It has great online support and community forums.

 It has a user-friendly data structure.

 It has extensive support libraries.

 It is interpreted language.

 Python provides database connectivity.

 It improves programmer productivity.

Disadvantages:
 It cannot be used for mobile application development.

 It has limitations with database access.

 It throws run time issues that cause the issue for the programmers.

 It consumes more memory because of dynamically typed language.

 Its speed is slow.

 Need more maintenance of application and code.


Xa = int(input('Enter First number: '))
Xb = int(input('Enter Second number: '))
add = Xa + Xb
diff = Xa - Xb
mul = Xa * Xb
div = Xa / Xb
floor_div = Xa // Xb
power = Xa ** Xb
modulus = Xa % Xb

print('Sum of the numbers is',Xa ,'and' ,Xb ,'is :',add)


print('Difference of the numbers is
',Xa ,'and' ,Xb ,'is :',diff)

print('Product of the numbers is


' ,Xa ,'and' ,Xb ,'is :',mul)
print('Division of the numbers is
',Xa ,'and' ,Xb ,'is :',div)

print('Floor Division of the numbers is


',Xa ,'and' ,Xb ,'is :',floor_div)

print('Exponent of the numbers is


',Xa ,'and' ,Xb ,'is :',power)

print('Modulus of the numbers is


',Xa ,'and' ,Xb ,'is :',modulus)

You might also like