Python Assignment 2
Python Assignment 2
EDUCATION TOINNOVATION
Date
Page No. : ...1
:
Assignment-2
Unit 3 FunehonS { Recursion
Defining
heturn alue
Calling funcien
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. ...?...
3
ns COnwasion:
Type
ponforming Dnnaion
mignd nood to Con west
Data fmatting
when eading dae from ile os datebases
neo to ttue doute to the
nolate
Recwnsien is
prgrmming techuiewe whenu
funeHn
eLse
netwn n fcactorialCn-1)
Nesult = factoial 5)
paint (oesut)
hesult = add53)
punt resut)
www.silveroakuni.ac.in
SILVEROAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. : ...5........
Gheymous functions 4 ho do
Hhey
diffen forom funckim in python
hau
3tetemets,
Realen hneh'os
ai atis
hirt,simp lu nenaions wte
funehom delini ion sD
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date :
Page No. :...6.
Symbol n
A de (OratoY
enhane henchom clen
Clo you to
Cunc hon extrafun
eionaliy
fnhim executocd wthout dine oty
chagig tue odginadFunches cocle
using te 6osymbol:
torator
ele
do f my deoratY (prefix)
bnp ut (Ent
(e my_derutr
def inal C):
pass
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. :....
A class is iko
templat fos CrSeatig ohiects, It lefines
taeshuctune p behawioun thet Dbects
Sthot class
Dojects
Aa abject
Methoc
A mothod is ca tuncion that s oJsoiatos
Hth an wey For cn 0bject
to intenact witth its dat or pen horm
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. :2
02
clate
Ohitcti
toma ically n te
claxis
in
www.silveroakuni.ac.
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No.: .....4.
How lo
ou dhey
delc
oject
ethad
in pytaen
in
ahad is
aject des buc hicn)
Ln. Dhject
Destucti
--del--c Metho d
acces modihns
pblic
piate (-priveti )
Public Memb ensa
pubic mmbes ane accesible bom ciysee
betth fuside etsido e clas
ponate Membens
pagixd
Cannot heaccesed oiret fm
aticle
Examu
cless
de f faitea (sef brend )
Sef. brand sbrend t public Athibte
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. :.....1,..
Class Carnolel
fuit- model): CseE
clef
sef.-mocle= no de #pivete Atibte
def qet- model CseLf)
Se IE=mod
phiuf tj b rend )
e
ACcessib
eDbj1 Car m odel Foy tunen)
will saise
psu'nt (obj1. qetmodolc2)
memen methot.
Access iwg pnnete a
Tnhentane
Iaher te n ce i6 cn Oop cncnt tht cellos a
Eno m
Codo
Paomettng msdulan pegamming
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date Page No. : .J.L
:
T m nheni tanu
1 Sing Iaheiten e
3 Mulileel lhitone
Heiraicaheiten ce
H ponent cls
Class Anim a
Ruhenihng fomAnimd
Dg
d Seak Cself):
AetnBusik parn etho
meet
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. : ....1.3..
uheri teun u
Polymorphism in pytnin
polymoTp hism llo
lesses to be tne ate a
Cem&n
s otecH
bcse cass
poly morpism
mathod ueidig thhl
Cthougla methe
n python)
aloaoug do not surt
Methot Duing
Metnad ouenidiwg cs
Specikie fmlemutatieo
Metho
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date :
Page No.: ...J.5.
clasS
de sound C sec):
netn Som0 qenenic Sound"
Sowndl see)
tn
(aw cas
Www.silveroakuni.ac.in
SILVEROAK UNIVERSITY
EDUCATION TO INNOVATION
Date : ....PageNo. : ...[5....
Pythtn am t Pythe
pakag
fython package usi g pip
\wstll--ungraole pip
stalli ng packal
package-rane
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date: Page No. :.
How Cen
gau we pytnon to intenact uith
esta us h C Cenction
Conct ne
wnsoY
module fn pyth
import mysqL. Connnectu
Cunser ohjeet
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. :....11.
SQL Quies
Pnt Cdb)
connechen- cosecs
Cs comnectes
lonect pyhon anicatis with MyaL
datoayes
2
Veni yi ug lstellatin
www.silveroakuni.ac.in
SILVER OAK UNIVERSITY
EDUCATION TOINNOVATION
Date:
Page No. :........
siug Python.
MysQl Sehes
dateut
Cettim dteb(oeaticn
tu csmeiom.
How do
Ceating
wsina pyton Mysal
Ecaml eatiy
pytm
www.silveroakuni.ac. in
SILVER OAK UNIVERSITY
EDUCATION TO INNOVATION
Date : Page No. :...)A....
# (onneet to te database
olatebe mydatabae
Csos Cownehin. cnsrC
aeato tebu
lose tu Comnectiem
www.silveroakuni.ac. in