lassmate
Dote
Page
Assignment-1.
helo wond
Simple ayogZour tat Display StntaH
Q0 of the
It's often' used to illyStotehe
Janguage
Ans Paint C hello worla ")
Outpot: Hello woldul
G2. Giue te eXarmale 0f inteactive Mode and Scipt
hode
Ang
Psint Cc)
Qutpot 9
3 wxite a Qso-or on tyee Vasiable cond a50
which tyee of Vaziale is imutable ound
boolen... e
Ans
Pont C e Tntegex)
Point Cre float' y)
Boolean true
print C Cooleo Boolcan
nune cC Alicel
point C CC
Stoing" ame
classMAte
Date
Page
Point Cet Topietuple)
list LL ,2, 3]
OutptJn teaex 0 Mutable false
floast 20. S Mutable false
boolean ]<ue Mutable fulse ot
Sting = Aice Mutaubl fols o
list >CI231 Mutable Tues1E
Mutable false
1
Bpe Ci,)
i) Lonutubie Vaxiable ]bier Volue Cannot he
Chang ed in ploce after Section, ex id Fu
boolean Stxingtupl
D) Mutoble vcxiab1e Theze Valve Ccun be
Changed in place
list Set dicinasy
write a progray On opertox witpioity
and
Priosty Determine which opexater is evavate
tixgt in
CXpression wihy mulHgle ofexate
AS5oCiawity Detemire the discehon of Cvalasn
precedvee apoeax together
Q6
Print Num Num Output ex
um1+Num 2 Qu woite
CCepsSimple OutputPoint ) C b Ccesult
Point ) #
2 t 8esult 4 of
Of Print C
C 20 ex
autb left
fddih¡n >
poogdcum
int int number of
Simple to opete
CC #
inputinput tignt
Of Hauddionab
tsom 1n soosam
thesg lCc C pybonn Q
sSociai eCaD
EntexEnter USer for
of
to
two USing
te the uiy
dd Vaxiables
fixgt Comment Page Date
Seond two clAssnte
Numbe' numbea
Wumbe
classmate
Date
Page
Output Entexo NUmbes o
Enter a Num ber 80
wite
pydhon soraon to findo te Squase H
Ang Float Cinput C Entes au numby J)
numGquaxe > Numbes 0.
Point C The Squaxe oot of thig no is".
Cnumbex Squaxe)
num
Q8. wxite a fyton poogwm to Calcolae te axeo
ofa tiangle
Ang float Cinput Co Crtos fiÝG Side:"))
b
float Cinput Cnteo o Second Side:"
CfloatCinput CCntes thid Side:
C8* C5-w* Cs-b) Cs)** 0.s
Co
point C e axeoo 0f te
aiangle is 0.z
classmate
Date
Page
woite SolveUadsoiC
equuticn
Ou 4
b
C>6
Pint Jhe Soluion axea and Eid 3 fosmat
C6o1, Son))
Qlowsite a pynon piogtani to Cheak fa numbes
is Pos itiue negetive 2es0
norm =.loautC input (" Brtes a numbex "J)
if Cnum ) ) ;
piint C Positiue numbex
Psint C Zexo"
eise:
1
Point Co negetive number
elassMate
Date
Page
Ch eale it lombex iS
write u Pyon to
eve
numbe
Ans num nt Cingut C En tex a
Point C Numbex is Cven")
Cise:
psint Cte uumbex iS odd ")
G 12 write a pyho Qsogram' to CheakYeas leap yeas
yeax = int Cindyt Cc Entes the ")
f CYeax /: 4 =0Qnd yeax lo00)
Cyeax
Point C F the Yeax EyCas iS leop yeax
eIse
point CES the yeas Yeax} 1S not \ea
Yeax ")
woite a python poog ami tß find.ithe laxg eSt
thxee numbexS
Ans
nor zFloat Cinot C Entex the fixst nomber
num > Floot Cinput (oc Enter the Second numba
num 2 Float Cint C Endex the thËd numbe
0f Cnom4) > num 2) Qund Cnumt) >num3
lasgest
elif C. nurm 2 numl nd nurm 2
else
laxgest
laxgest 2 num
clsssmate
Date
Page
rint Ce The loxg est nurbey is: Jaxg es+)
QH.wite a pthn pxogaam to poime num bes$
num int CinQutC Entex the nunbeyi
flao folse
faint Cnum iS not
n
fos in tonge C2 num J:
if Cnurm i R 0
flag
point CCnum is not o pime nombex ")
Qis site Corplex nombex
Ars Class Comp)ex Number
-def inít CSelf teol tee imoginaly
Self teal -teo
Seat.imagi naly eimaginaly
det. vdd CSef othes
Seif. imaginay Oth ex imoginaxy J
clASSMate
Date
Page
det SubCSeif.othexJ
xetur ComplexWOmbes Selt teo 0t
Yeo
SOf inaginasy OBher imaginary]
def mul Cseit. othex
past C SeIt xeal
otheaect)
(
CSeif imaginaay * Othes imaginary
imaginaaylast- C Seif. xer * 0ther.imagihe
Paxt)
if man
1 Compiex Numbex C3
(C2
PrintCECC C EcI
Print C C2:623)
Psint CFobSca iphion i
c23) EC13n&
C23)
PointCe HE ENO