We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
sae |
Medide Fev Hattemedital evel?
pelt: \ Sperection
Alm?
Writ Re python Pregvam +0 Greet: medole
ajhteh consisting marten aticat
Wgorrth m oy metth,
opeattons
SapeNs PY
Steplit steed the Program
Shea: bs Squecse Cx)!
tt Takes a Single corgumert g.
12 Retoms Me Sqvewe of by
moblipying cx by Hselk.
Steps: 2+ Cobe cx):
Takes a single cexqum ent x.
>Retoryns he cvbe % x by mo Hiplfing
2 ree times Cx* vty),
stepu: abs_ valve Cx):
=>Takes a single ag vrnorct Xe
=>PReloyns te ahsoluit vate 4 2 Using
the abso) -punction,
Steps ; Power (x.y)!
= Takes single ascq uments ee andy:= Relorns he x power ey.
Stepb + Srost Cx):
=> Take single aexgumarnt OF x
PRebna he root vate of x.
stepF? stop ~ipe Pregvem.
| Algorithm fey Nalin paoqvam. Py
stepi: shat Ro progvam.
Stepat ?mpeyt — meilA_epev medole.
steps: Using functions from “the math_opey
medule +e pergeovm “Re following.
Colle gonction frrem matt opevedtton
to pergorm Calewledfons.
Steph: Computes “The Sqveea of 5 using
moth_ oper + Sqvee (5) ard stoves
He vesulf-
Steps: Computes “Iho Cobe af 3 using maith
oper. cobe 03) and stoves “Re remit
Step6: Computts the obsolite velbe F ~4 oSirg
math Oper. abs -valve C3) ard
stoves the ves lt,
NeerStepti Compute ~iRe power % Sr using |
metlh -cper+ Fewer C5: 3) and stores
the vesulk.
Step at Comp ute AR sv0ct Valve ef Cian)
using mooi oper: Sroat (121) and |
Stoves the valve.
stepr? Displays Re vesvlt.
Sleplet Stop the programe
Program ‘
Hmetih oper »py
impos motth
deg Sqvewee (xd*
yetvin *
le lobe (D*
gern 27 HT
ag abs- value (2)!
yehtrn abs Cx)
deg. Powey (sg):
rehorn 2 **Y
des Sroet (x)! |
vredown matth + sqrt (a)
eeeMalin - pregram. py
| fmpert meth - oper
TO SRBE = meth oper Square (2)
| 18- squase = metth - oper. cube C3)
yes obs = methi-oper, abs_valve (-+)
wes - power = moth oper. power (5) 5)
wO- sreot = meth oper. Svoot iat)
point Squve of 5 5 Ves - Squeesee 5
pant ("cube of 35 168. cube)
punk C"Bbsolie vale op “Fa 3) 1@-ebs')
pint C'5 pewey as fst *, wes. power)
print ("Soot op far: "ves. sicet)SGuay €
Of Bt BB
Cube of 3.2 af
Absolote Yalue of -T rt 4
5 poller 3 ge PYRE”
Sroot of 12) 4 roves
gies
xy om
OK
he '
Cx) uslad
RYidAy oe
Cy 9
ee
\ x n
aah
Cx)\
wa les
Fe VACA ‘
V4 on
&