You are on page 1of 17

WHAT IS PYTHON?

 Python is a very popular general-purpose interpreted, interactive, object-oriented, and


high-level programming language. Python is dynamically-typed and garbage-collected
programming language. It was created by Guido van Rossum during 1985- 1990. Like
Perl, Python source code is also available under the GNU General Public License (GPL).
 This tutorial gives a complete understanding of Python programming language starting
from basic conceopts to advanced concepts. This tutorial will take you through simple and
practical approaches while learning Python Programming language.
Characteristics of Python

Following are important characteristics of Python Programming −

 It supports functional and structured programming methods as well as OOP.


 It can be used as a scripting language or can be compiled to byte-code for building large
applications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.
 It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
Applications of Python
The latest release of Python is 3.x. As mentioned before, Python is one of the most widely used language over the web.
I'm going to list few of them here:

 Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax. This allows the student to
pick up the language quickly.
 Easy-to-read − Python code is more clearly defined and visible to the eyes.
 Easy-to-maintain − Python's source code is fairly easy-to-maintain.
 A broad standard library − Python's bulk of the library is very portable and cross-platform compatible on UNIX,
Windows, and Macintosh.
 Interactive Mode − Python has support for an interactive mode which allows interactive testing and debugging of
snippets of code.
 Portable − Python can run on a wide variety of hardware platforms and has the same interface on all platforms.
 Extendable − You can add low-level modules to the Python interpreter. These modules enable programmers to add
to or customize their tools to be more efficient.
 Databases − Python provides interfaces to all major commercial databases.
 GUI Programming − Python supports GUI applications that can be created and ported to many system calls,
libraries and windows systems, such as Windows MFC, Macintosh, and the X Window system of Unix.
 Scalable − Python provides a better structure and support for large programs than shell scripting.
PROGRAM:-
from tkinter import *

def click(event):
global scvalue
text=event.widget.cget("text")
print(text)
if text == "=":
if scvalue.get().isdigit():
value = int(scvalue.get())
else:
value = eval(screen.get())
scvalue.set(value)
screen.update()
elif text == "C":
scvalue.set("")
screen.update()
else:
scvalue.set(scvalue.get()+ text)
screen.update()
root=Tk()

root.geometry("400x550")

root.title("calculator")

scvalue=StringVar()

scvalue.set("")

screen= Entry(root,textvar=scvalue,font="lucida 20 ")

screen.pack(fill=X,ipadx=8,pady=10,padx=10)

f=Frame(root,bg="grey")

b= Button(f, text=".",padx=20,pady=18,font="lucida 15 bold")

b.pack(side=LEFT,padx=15,pady=10)

b.bind("<Button-1>",click)

b= Button(f, text="0",padx=20,pady=18,font="lucida 15 bold")

b.pack(side=LEFT,padx=15,pady=10)

b.bind("<Button-1>",click)
b= Button(f, text="C",padx=20,pady=18,font="lucida 15 bold")
b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="+",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

f.pack(padx=5,pady=5)

f=Frame(root,bg="grey")
b= Button(f, text="9",padx=20,pady=18,font="lucida 15 bold")
b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="8",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="7",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="-",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

f.pack()

f=Frame(root,bg="grey")
b= Button(f, text="6",padx=20,pady=18,font="lucida 15 bold")
b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)
b= Button(f, text="5",padx=20,pady=18,font="lucida 15 bold")
b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="4",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="*",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

f.pack()

f=Frame(root,bg="grey")
b= Button(f, text="3",padx=20,pady=18,font="lucida 15 bold")
b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="2",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="1",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

b= Button(f, text="/",padx=20,pady=18,font="lucida 15 bold")


b.pack(side=LEFT,padx=15,pady=10)
b.bind("<Button-1>",click)

f.pack()

f=Frame(root,bg="grey")
b= Button(f, text=".",padx=20,pady=18,font="lucida 15 bold")
b.pack(side=LEFT,padx=14,pady=10)
b.bind("<Button-1>",click)
b= Button(f, text="0",padx=20,pady=18,font="lucida 15 bold")

b.pack(side=LEFT,padx=14,pady=10)

b.bind("<Button-1>",click)

b= Button(f, text="00",padx=18,pady=18,font="lucida 15 bold")

b.pack(side=LEFT,padx=14,pady=10)

b.bind("<Button-1>",click)

b= Button(f, text="=",padx=20,pady=18,font="lucida 15 bold ",bg="blue")

b.pack(side=LEFT,padx=14,pady=10)

b.bind("<Button-1>",click)

f.pack()

root.mainloop()
OUTPUT:-
Comparison Table for Advantages and Disadvantages of Python

Advantages Disadvantages

It is easy to learn and use, and it has an Because of its elementary programming, users
extensive library. face difficulty while working with other
programming languages.

Python increases productivity. Python is a time-consuming language. It has a


low execution speed.

It is very flexible. There are many issues with the design of the
language, which only gets displayed during
runtime.

It has a very supportive community It is not suited for memory-intensive programs


and mobile applications.
Definition of Python SQL

Python SQL is database interfaces that are currently available: Interfaces and APIs for Python
databases. Every database which was we have accessed requires its own DB API module. For
database programming, python includes a lot of useful capabilities. All the SQL databases are
supported by Python-like MySQL, SQLite, PostgreSQL, etc. Python also supports data
definition language and data manipulation language.
What is Python SQL?

 The Python DB-API is the industry standard for database interfaces. This is the standard
for most Python database interfaces.
 SQL can be used in a variety of ways in Python. For this reason, a number of libraries have
been built that can be used. These libraries include SQLite and MySQL.
 Python’s database interfaces employ the Python DB-API, which is the standard used for
the interface of the database. The DB-API is a standard interface for accessing relational
databases. In other words, regardless of the database or database module used, the Python
code for connecting databases is the same.
Future Technologies Counting On Python

Generally, we have seen that python programming language is extensively used for web development, application development, system
administration, developing games etc.

But do you know there are some future technologies that are relying on python? As a matter of fact, Python has become the core language as
far as the success of these technologies is concerned. Let’s dive into the technologies which use python as a core element for research,
production and further developments.

(1) Artificial Intelligence (AI)

Python programming language is undoubtedly dominating the other languages when future technologies like Artificial Intelligence(AI) comes
into the play.

There are plenty of python frameworks, libraries, and tools that are specifically developed to direct Artificial Intelligence to reduce human
efforts with increased accuracy and efficiency for various development purposes.

It is only the Artificial Intelligence that has made it possible to develop speech recognition system, autonomous cars, interpreting data like
images, videos etc.

We have shown below some of the python libraries and tools used in various Artificial Intelligence branches.

Machine Learning- PyML, PyBrain, scikit-learn, MDP Toolkit, GraphLab Create, MIPy etc.

General AI- pyDatalog, AIMA, EasyAI, SimpleAI etc.

Neural Networks- PyAnn, pyrenn, ffnet, neurolab etc.

Natural Language & Text Processing- Quepy, NLTK, gensim


(2) Big Data

The future scope of python programming language can also be predicted by the way it has helped big data
technology to grow. Python has been successfully contributing in analyzing a large number of data sets across
computer clusters through its high-performance toolkits and libraries.

Let’s have a look at the python libraries and toolkits used for Data analysis and handling other big data issues.

• Pandas
• Scikit-Learn
• NumPy
• SciPy
• GraphLab Create
• IPython
• Bokeh
• Agate
• PySpark
• Dask
(3) Networking

Networking is another field in which python has a brighter scope in the future. Python programming
language is used to read, write and configure routers and switches and perform other networking
automation tasks in a cost-effective and secure manner.

For these purposes, there are many libraries and tools that are built on the top of the python language.
Here we have listed some of these python libraries and tools especially used by network engineers for
network automation.

• Ansible
• Netmiko
• NAPALM(Network Automation and Programmability Abstraction Layer with Multivendor Support)
• Pyeapi
• Junos PyEZ
• PySNMP
• Paramiko SSH
THANK YOU

You might also like