Basic Python Notes
Basic Python Notes
Basic Python Notes
Intexpretedlanguage
|Object-Oyiented 1anquage.
Open sOuYCe |anguage
Extensible
Embeddable
Dynamic MemoYy Allocatlon
"Cqur Programming suppoxt.
where is Puthon used?
Dara science
Dara Mining
Desktop Applicatons
Mobile Applications.
web Applications
Machine learninag
3D CADApplications
SpeechRecognitlons
Dcie
Mathematics : Numpy
Nympy pandgS etc.
Puithon axiables.
Python Variable is a nane that is used to
refer toD MeMory 10carion. Pytnon vaxiable
is alsO Knon as identiCiex and used to
hold alue:
classMate
Date
Page
Python 10ops.
The while loops
witn the mhile lo0p e can
execute a Set of Starements as long as Q
condition is tyue
Example
while i<6:
prlnt (i)
3.
classMate
Date
Page
Example i
S+Y= Vedant
foY i in stx:
Print(i)
Exgmele:
aqe int(input("Enter your Age"))
age
print("you qre eligible to vote")
else:
print("yos are No eligible to vote" 4.
classMAte
Date
Page
Rython function
Pathon function axe the Most iMpoxtant
aspect of an application. A Function can be
setined as the oxagnized blocK of
xeusable code, mhich can be caled
Jnhen evey required
Cyeating function.
Python provides the def Keyword to define
the function. The syntax of the de Cine
Funcion is GiVen below
5.
cAssMate
Date
Poge
Suntax
def My.funcion(Paraqmeters) :
unctlon - blocK
etuYn Expression.
AuL aMM LINKEDIN)
ExaMple : NOrES GAMUeYGEEYRAM).
def suM(): # Defining funcion
b= 20
xeturn c
#Calin sum function in pxint
statement
print("The sum is :", suMO)
Pthon Arxays
An array is ga collection of a similay tupe
Of data and stored it into the contiaues
MemoÝy 10cqtion THe îndex of an array
is starting nith Q I ee can access each
element via itsjndex.