What Is Python - 0

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 37

What is

python
Python is a computer programming language often used to build
websites and software, automate tasks, and conduct data analysis.
Python is a general-purpose language, meaning it can be used to
create a variety of different programs and isn't specialized for any
specific problems
or
Python is a high-level, interpreted, general-purpose programming
language. Its design philosophy emphasizes code readability with
the use of significant indentation. Python is dynamically-typed and
garbage
What is Programming
Language
As we know, to communicate with a person, we need a
specific language, similarly to communicate with
computers, programmers also need a language is called
Programming language. Before learning the
programming language, let's understand what is
language
What is Language

Language is a mode of communication that is used


to share ideas, opinions with each other. For example,
if we want to teach someone, we need a language that
is understandable by both communicators
What is Programming Language

A programming language is a computer language that


is used by programmers (developers)
to communicate with computers. It is a set of
instructions written in any specific language ( C, C++,
Java, Python) to perform a specific task
Usage of Programming Language

A programming language is mainly used to develop


desktop applications, websites, and
mobile applications and other
softwares.
Hardware Software Firmware

Programming
System Software Application software Language
Software
Programming language
software

Low Level P-L High Level P-L


Low Level Programming Langage

Low-level language is machine-dependent


(0 and 1) programming language. The
processor runs low- level programs
directly without the need of a compiler or
interpreter, so the programs written in
low-level language can be run very fast.
But understanding low level language for
user are very difficult
High Level Programming Language
High-level programming language (HLL) is designed for developing user-friendly
software programs and websites. This programming language requires a compiler
or interpreter to translate the program into machine language (execute the
program).
The main advantage of a high-level language is that it is easy to read, write, and
maintain.
High-level programming language includes Python, Java, JavaScript, PHP, C#, C+
+, Objective C, programming language.
What is program
Programs are collection of
instructions executed by computer
or user to perform specific tasks on
computer
Or
Program is a collection of data and a
set of
Instruction or procedure on that data
to do a
Specific task.
How we can make a software
For making a program we must know the
programming language programs like c, c++ , c# ,
java

If we know these programs we can make a program


or a application
The basic program in making software and program
or websites in python
What is Python
Python is a computer programming
language often used to build websites
and software, automate tasks, and
conduct data analysis. Python is a
general-purpose language, meaning it
can be used to create a variety of
different programs and isn't
specialized for any specific problems
or
Python is a high-level, interpreted,
general-purpose programming
language. Its design philosophy
emphasizes code readability with the
use of significant indentation. Python
is dynamically-typed and garbage
Usage of Python
• Using of Artificial intelligence in python
• In dynamic web designing
• In making robots
• For testing software and webpages
• For Cyber security
• For making simple Script
• For making program
• For linking database to web sites
• For making Mobile Application
Python Certification Level
• PCEP- python certified Entry professional
• PCAP-python certified Associate professional
• PCPP-python certified professional programming
• CEPP-Certified expert in python programming
What is Editor , Compiler, Debuger and IDE
Editors
are the programs which we can
write the codes on it
Compiler List
Compiler  Programiz.
compiler is a special program that  PyDev.
Convert our written statement in a
programming language into  PyCharm.
machine language or “Binary".  Sublime Text.
Typically, a programmer writes
language statements in a language  Thonny.
such as Pascal or C one line at a  Visual Studio Code.
time using an editor
 Jupyter Notebook.
 Vim
What is Data Type
A data type, in programming, is a classification that specifies which type
of value a variable has and what type of mathematical, relational or
logical operations can be applied to it without causing an error , and these
are the data types

X=1 Number(int)
y=1.2 Float
Z=1j Complex
P=‘ahmad’ String

Print(x) it show the data type of a variable

Print(type(x))
Print(type(y))
Print(type(z))
What is Variable

A variable is a way of storing information in a computer program. Think


of a variable like a container and the name of the variable as the label on
the container which shows us what is inside

 The first character of a variable must no


X=1
start with number
y=1.2
Z=1j
 No Space in variable
P=‘ahmad’
 Variable can accept and under score
 We can not write the command of pytho
Print(type(x)) as a name of veriable
Print(type(y))
Print(type(z))
keyboard=4000
Computer=3000
Print(keyboard+Computer)
keyboard=‘4000’
Computer=‘3000’
Print(keyboard+Computer) it gives Error

keyboard=‘4000’
Computer=‘3000’
Print(int(keyboard)+int(Computer))
Error type
Syntax Error

Runtime error
Syntax Error
Syntax error is a grammerical error in python
print 123
print(123)

Runtime Error
A runtime error in a program is an error that occurs while
the program is running after being successfully compiled
open(‘flower.jpg’)
Input from keyboard or user
name=input(“Enter your name:”)
X=int(input(Enter first Number:”))
Print(“your name is:”)
y=int(input(Enter second Number:”))
Print(name)
Total=x+y
---------------------------------------------
Print(total)
name=input(“Enter your name:”)
Print(f“your name is {name}”)

X=float(input(Enter first Number:”))


y=float(input(Enter second Number:”))
Total=x+y
Print(total)
What is Library
A Python library is a collection of related modules. It
contains bundles of code that can be used repeatedly in
different programs. It makes Python Programming
simpler and convenient for the programmer.
Or
ython libraries are used to create applications and
models in a variety of fields, for instance, machine
learning, data science, data visualization, image and
data
What is Library
EX:

NumPy Library Advanced Math Functionality


Scipy Library For Scientific Functionalities
Tkinter Library For Graphical Design
Malplotlib For chas , plots , Graphs
from tkinter import *

window=Tk()
Creating lable and
window.title("hi and Hello")
window.geometry('500x300')
Text BOX
lable1=Label(window,text='Enter Your Name:',fg='blue',font=('Arial',14))

lable1.grid(row=0,column=0,padx=5,pady=10)

textbox1=Entry(window,fg='blue',font=('Arial',14))
textbox1.grid(row=0,column=1)

window.mainloop()
from tkinter import *
root Tk()
root.title('your title')
root.geometry("400x400")
Creating Combo
options= [
"sunday"
Box
]

cliked=StringVar()
clicked.set(options[0])
drop = OptionMenu(root, clicked ,*options)
drop.pack(pady=20)
root.mainloop()
Creating
Import tkinter
from tkinter import *

window=Tk()
window.title("hi and Hello")
window.geometry('500x300’)
Radio
r1_1=tkinter.StringVar()
Buttons
r1_1.set(None)

r1=tkinter.Radiobutton(window,text=‘Male’,variable=r1_1,value=‘Male’)
r1.grid(row=1,column=1,padx=50,pady=50)

r2=tkinter.Radiobutton(window,text=‘Female’,variable=r1_1,value=‘Female’)
r2.grid(row=1,column=2)

window.mainloop()
import tkinter as tk
from tkinter.ttk import *

root = tk.Tk()
Creating
root.geometry('100x100')
Buttons
btn = Button(root, text='Click me!', command=root.destroy)
btn.pack(side='top')

root.mainloop()
from tkinter import *
root = Tk()
frame = Frame(root)

Creating
frame.pack()
bottomframe = Frame(root)
bottomframe.pack( side = BOTTOM )
redbutton = Button(frame, text = 'Red', fg ='red')
redbutton.pack( side = LEFT) Buttons
greenbutton = Button(frame, text = 'Brown', fg='brown')
greenbutton.pack( side = LEFT )
bluebutton = Button(frame, text ='Blue', fg ='blue')
bluebutton.pack( side = LEFT )
blackbutton = Button(bottomframe, text ='Black', fg ='black')
blackbutton.pack( side = BOTTOM)
root.mainloop()
import tkinter as tk
root = tk.Tk()
Creating
root.title("List Box Example")
root.geometry('1000x1000')
List box
items = ["Apple", "Banana", "Cherry", "Orange", "Grapes"]
listbox = tk.Listbox(root, selectmode=tk.SINGLE)
for item in items:
listbox.insert(tk.END, item)
listbox.pack()

root.mainloop()
import tkinter as tk
Creating
root = tk.Tk()
root.geometry(“900x900”)
Check box
root.title("Checkbox Example")

checkbox_var = tk.IntVar()
checkbox = tk.Checkbutton(root, text="Check me", variable=checkbox_var)
checkbox.pack()

root.mainloop()
from tkinter import *
root = Tk() Creating
menu = Menu(root)
root.config(menu=menu) Menu in
Python
filemenu = Menu(menu)
menu.add_cascade(label='File', menu=filemenu)
filemenu.add_command(label='New')
filemenu.add_command(label='Open...')
filemenu.add_separator()
filemenu.add_command(label='Exit', command=root.quit)
helpmenu = Menu(menu)
menu.add_cascade(label='Help', menu=helpmenu)
helpmenu.add_command(label='About')
mainloop()
from tkinter import * Creating
master = Tk()
w = Scale(master, from_=0, to=42) Scroll Bar in
w.pack()
w = Scale(master, from_=0, to=200, orient=HORIZONTAL)
w.pack()
Python
mainloop()
from tkinter import *
master = Tk()
Creating
master.geometry('1000x1000')
w = Canvas(master, width=4000, height=6000)
Line
w.pack()
canvas_height=20
canvas_width=2000
y = int(canvas_height / 2)
w.create_line(0, y, canvas_width, y )
mainloop()
import cv2
Importing
img = cv2.imread("sheep.png", cv2.IMREAD_ANYCOLOR)
picture in
while True: python
cv2.imshow("Sheep", img)
key = cv2.waitKey(0)
if key == 27:
break
cv2.destroyAllWindows()
What is Module
A Python module is a file containing Python
definitions and statements. A module can define
functions, classes, and variables. A module can
also include runnable code. Grouping related code
into a module makes the code easier to
understand and use. It also makes the code
logically organized
7
8
9
13
14

You might also like