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

Python Assignmnent 2

Uploaded by

hinalyma235
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)
4 views

Python Assignmnent 2

Uploaded by

hinalyma235
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/ 13

penartment of Computer Science &Engineering

Faculty of Engineering &Technology ((TER)

Owrik Da Such that Tythen bill

Code

Print ("nye)

unbella

an lunthella )

Drint ( no hced t
înnt (ye )
Cutut
Ss it rainiy?(Va/to): Yes

nlo need lo Cavyy an nhella


Name: Regd. Number:
Department of Computer Science &Engineering
Faculty of Engineering &Technology (ITER)

O Writ agtion Codk do caleuate a Shuden's

Drint (Gade A
-Extelent")
Drint (" arade: s - Goad)
Print (iade;e - Arerag)
Outpet
() Enter yawn Scor : 5
( wre a
4hat tahes an
Usen wheath the numba ig intger inpt from
mum e lnt ( odd the vsen Cnd
inpu ("Enten an o eve
num 2 0 ntsger;^)

(i)Entn an htger;y
(U) Ento an
5 otd. 'Lateyen:

Name:

Regd. Number:
Departiment of GOmputor Science &
Baculty of
Engineering &TechnologyEngineering
(ITER)

V ehethon it4 leapye


Ven int( npat ('Entn a
yew;))
hint (H Yeay y a lesp yen ")
rlnt ("yean iy not tep yes).
Dutut
() Enten aYean s 90 24 (ü) Enten q yean! 2023
Jo24 iA a leap Year Qo23 i8 not a leap yean.
wrik a inut trom the Usoi
opon that anes an Dntegor
int Cinot ("Ente a Namben))
num 1:
for to in range ( 2, fan )

rint
Output
Entn a nlumbn
Engineering
Science &
Department of Computer (ITER)
Faculty of Engineering &Technology
rogran
Complee
Quetim Write a nunbe
eh -he previus iaput
Q. User
Prcime unber hclow
Sel:
def ierone (n):
i(ntb05)+ :
for i in nange (2,
rekurn faloe.
retuu tue
lnit int (input ( Enton a Nmb)
age (2, nit)

Outut
Enten a numben s, 20

proga thet tase

So|+ Dum int (input (Entor a posikre num ben


while num 0
"))
num : t inpud "lease ente a Paike numben :))

ese:

Output
(0 tor5
Ertey a oste Al bmben. s
The rtes t i8 25 The reelt s .

Name: Regd. Number:


Department of Computer Sclence & Engineering
Faculty of Engineering & Technology (ITER)

Wri a
roambf ke nemaiaden when a U
sen

y :
nums id (input ("Enten an integen: )
metch num .5:
Case o:
Pris (f "The nemahden when fnumy ig diial ed

Cese 4:
rit (f The remaider when fnum i) div ided by 5 i)

2)
Pruns (+'The riemainden when fhum} i8 dirided by 5 ih
Case 3.
Prind (f" he tenender when nun? is diided bys 3

expee! Vale Error:


Prunt ("Tnyal:t Tnput

the enainder ohan 1a is ided hy5 ia 2.


0

4eyt e inprd ("Enten a shing "


fo i in range ( len (Hery) :
to Jin nange (it , ea (teyt)+ 1)
Prund (4ey+ [l:J)
Duttut

Name: Regd. Number:


Department of Computer Science & Engineering
Paculty of Engineering &Technology (ITER)

lwkite rue:
expn i^pt ("Enten Zwo numbens end an openadd tei? to
Qut:")
hneen

num | num2= float (rum1) , flvat( nun 2)


t opeatr "4":
Prdnt (f "resalt fnum tnm2)
rín l " Result :oum)- num2y

rut apenat4Resul {num nunz


euf oporatrs "J":
ele:
Print ( "unknoum Operaths)
expet Vaue Err;
Prunt (nval'd Dnput)

Ente tu Alumben Qnd an opoats


result 0
Þsexit to quit
ntrt twu rnmbens Gnd an oPrats Crs'extt it:

Name: Regd. Number:


impat mean mode me'an

prins (fMeon: fhean (Heta)


phind ( Medon: ^medt an (4uta)}
pri nt (" Made : Shorde (data)Y)

Mean; 3:
Med?an: 40

Name: Regd. Number


Engineering
Department of Computer Science & (ITER)
Faculty of Engineering &Technology

(49

rlaomupe input ("Enten tye (stantand /oleluse/ sue )


"). lowcn()
nigkts ind (inpt Ento the nun ben ct nghty: ")

logett- mem ben Crpd l" Are you a

Thtes : "stondord i Jou, delkuye': 50. "Suit ": 250Y


Pricer [Rom types J* nghts
tDsaunt and Suncharges
distount 0 20

ese:
dis cound
seas on : "yes':

Cast s O:&5
Ogelhy- memben
tTinat Cost aften d's cont
Snalosts Cost * Cl- dis Crud)

Name: Regd. Number:


Department of Computer Sclence & Engineering
Faculty of Engineering & Technology (TTER)

(utpt
rlom ype (sandand / eare/ Suie);debre.

menben Cyes/ nlo): Yes

cliisss [: fus ia n range (1 n)if n 0 J


netun Sum (i'vi soca) n
mum =it( Inpet "Enter a nlunbo"))
if ig.Porfect (nun):

Enten a numbas: 6
6 i a penfect alun ben.

Name: Regd. Number:


Number: Regd. Name:
130y158730
lS& O.
Seies
terms unbo
o the nten t
2 ofvalue the taten
Butet
$Sum-ay)
Soies! the ofSum Cint
"(4
ten to
Sum-a
oftons:") bon num "Entent (input( int ns
")d! Valse the "Ente inpt( floct(
math mpont
(ITER)Technology Engineering& Faculty
Engineering Science&Computer Departmentof of
Department of Computer Sclence &Enginoering
Faculty of Engineering &Technology (ITER)

()

print (t end )
Count 1
¿Caut o 0
rint)
Outpat
|26
I55 I66 I6
130 3 145 150 5Y
|44

qes i in range (In lo)):


Continue
unt (i end" )

Name: Regd. Number:


Name:
Number: Regd.
9s 22, C1utn: 4
;120 Irnteger anErter
fuctrs)
else
1! nvm while
2
")itegu nEnten input( ( at hum
432) nunben Keneese
numho
in(st numtieve.
T:: (num)
J)
(a)
Engineering& Frculty
of
(TER)Technology Department
of
Engineer Science&Computer
ogy (1TER)

Sa
ded is fuctniad (n):
whilk feet n

stehern faet sn
homs i t (input ( aEnten a numbon", D)
1f i.factrial Cnun):
rnt {'Snumy ) factut al numben )
else
frant (s"fn un iy not a tuctrtal onben )
Outeut
tntn
|20 a tectotal numben .

"))
mum s int ( input ("Enter a numben
whbe num > 10:
num s

Entei a
2
<The Single olisit Sum i ;
Enten e Numben: 123y
The Side- diqít Sumis : 1
Regd. Number:

You might also like