0% found this document useful (0 votes)
12 views

Python Programs

Uploaded by

muskanmeena657
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Python Programs

Uploaded by

muskanmeena657
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

saa awenage Callat #

(Sa) SUn Aales total


Soaled tatal Calulat +
(sale) appnd Sals.
sit) (p"galesmn (nput FLoat
Sale
Salus
]
sale steu to it mitiallze
a #
Sadeb
mnaxmum Ounel
aweage tstal, cclulate Puogrum
to #
ales. Ttal
aiy aelmarmwm
wuile
RAM PROG PeBASIC PYTHON
No. Page No. Expt.
# fmol minmum ard manimm Solls
min- Sals = min(Sals)
mem l Soles)

# Disbloy esulti
pint ("nSas Data Summasy:")
punt ( e" Tatal Salea: totl Sals ?")

pumt (P" Avuage sals: auwag sals")


punt lF" Hinimum Salls: mn-Sals ")

pint (p" Manimum salu : man -Sl ? ).


Date
Expt. No.
Page No.

2. lute a

t Caleulatae Pognasn
defcaleulaterc):
nsunatuen :")
phint (u 1. Addion t)")
pint (u2. ubhachien (-")
punt (u3 Mulb'plicatuom (*y")
phntu5. Hoculus 1e) )

cheee = input l" Emten yu chsee Cilalslu/s):")

Alumbhs
num = float (input ("Enten Hu fietnumbei: )
hum2 :Ploat inut "Entes Hu acend

# Puyem ofuuatiom
num)

s : nml-nm23")
n
pHnt Le" The usult

Teacher's Signature
n m 2 =0:

allu
waol choelPa
C slet a val
# Rum HL spunatusn,)
Caleulte
Calculat ().
Expt.No. Page No.

wite puogsam to punt Aocts'a

# Buagam to caleulate Hhe toetoal af a gin


Mumh

olut faeteal lnum):


nwm<O

Hutum
gutive numh
Hetum 1

etun lt

Calelat it facteal : )

F Dutput : Plint Pactsuial


Cnumbu)3").

Teacher's Signature
Enemee
Emempl Runs EX

Input i5 output I20


lnput 0 QUtRut0
euput, "fctoa4

Cnput i-3’
i- 3
tor nugaie numblh.
Date
Expt.No,
Page No.

4. Wite apgam top t Ai'benoacel


us to a giuin dgume
Prcqrann tetoR
pumtt Pibonacei suqusse us to a

Fibonacei sequwm
punt (Ebenacei dge up to ",n,)
# loss to puimt eibenacee humhet us to n
Wwwie ae
phmt(a enel= )
# Wodat aa and b

Puunt Eihenae

Teacher's Signature
Date

Expt.
No. Page No.

5 Wie apgram to nt

ancl &m[nm):
# Jiholize 0Aables

cel calculate

wi
o t =nm- lo # 4et the ast cait
Aldlnm hees_num*
euilet
to Sun

fromum
Jetum hewhd_nAn+

Teacher's Signature
# duteut

puunt (" u um oy Huu

Enample
neut |234dJ.
dutput
Su
Page No,
b. to
DclHlt

to
dtucent
pemtage
Ennclpunge,cMsLon omol
dl
oleulatst totL-mahks, htcund
mate)
# callau
puentag
# Oetehmintun aluucin
>=60:
diuisien
i pueutag >= 50:

pentag Thd iiion


aluilon

# Detonminatuen lt

diusion, sult
trun petag

Teacher's Signature
Get tetal muks aud obtaiuud
# uut :
total-mak tt Hoat (inbut ("Ewker totad warks ")
obtained manki - Poat (inbut ("Ewttr at aiel
#Output: Caleulat1 Cd pumt pencag, iils
pentag MSLnLAt
duwisen Caleulat uw
(totul maks, obtaudl_mak)

pnt (p* : .")


Puueumtag
punt (p' Qiusion

2
Expi. No.
Date
Page No.

Wste a
pnt
paltesn

# Raigkl

2) Tmwested Poten

# StatPatlern
uentecl (n)
amge (n,o,I)
pint (i*

Teacher's Signature
Expt. No.
Page No.

Pyuamicd Pottehn

Cn-i)t 2*i-1)
nmt (unswt "Entu n m s4 s , " )

4 Dianmond Pattehn

dt amenel Cn) :

(n-)

tang (n-,0, -):


pint (!! n - ) t *(2+-1))

diamemo (n).
blu match
eik mathsteka)
mut dast
matchshcki." Hu lesel)
")You
dhck
Page
No,
)
") play-pick
Yau
mathstik. maatchshiks: pick
Eotal-moatchsieka
-=
playe-pick
Signature
Teache
total
to
>i ua
("waid_
punt loned
tt: =1:
motchsck
teta-
H mnatchtka Hatchsheks
2,3, 4 <
h pük
matchshekA leu"
2|
= matchstick's
hun
1,23
Çame
Mateustok
# play-
Cemti
puck #Playe
otal (int bxuak
cam
Yu t
wtue
tata
No.Expt.
# Computen 's thn Computer pieks 1
comput-pick = 1 #
#
stotegy)
mateh sthik ( bawe
prut ("Cemmputer peks", comput -pek, mat
tstal- matchstcks - = loneutes - pick
print ("Hattehstiek l t i ", tetal matchaicku)

# hek t computu lo4ls


t totl- matehstcks ==1
prunt (" The compwt us foes to pck
break
Date
Expt. No.
Page No.

lte
mm

cut pne mumbh):

kinn fal # Aumhn less than or


1 aue
eeualto
mat me
wange (2,nt (num buy*o6)+):

etu fali # Meta phin numbs

#
pamu lnum):

pcme numblt)
Expt. age NO.

10. whit a

impsut matpletibpypst plt.


# Rael teunpath o a memth

memth(Bo oday):)

teanpatuu. aspmil
apfumel Ltemp)
# platteny He ghaph
templaha)
plt nlabl ("Dauy")

You might also like