You are on page 1of 5

ASSTnmet-2

,JNch dotatype of Python hondle Numbert


2, Jhy Boollan Considved as Subtype of Tntegvs?
B, whot ußN be t otput of the follouig9
))otl
PYirt (len (SEY CH/I4 )
o'p=
Trt (ien (sYCI¥ /4)))
o/p=
A, Gfven that vaiable CK 1s. bound to Sting
'Roman" Cie ck=
'Raman")Whot ufN s the output produced by following
by follbuirg two s+otennt i the Frput ven tn"
Roman
why? DR=înputCEnter va:") )D=- Ck ) DR 1s CK.
Entey name : Raman
5, What wil be otput pYoduced by the three expressons
ot the follouw?ng Code.

b=-3
C=25
d=-lo

atbtc>at(-b*a'ortotir
6, Nat would be the output of tho
follew?g ode?
Explafn Reason
a=3+5g
b=Fnt(34 b/:)
e tflot (6/s)
a+-loat C6)/8
e+6o/s
t (3+5 /8.o)
n t Ca,h caet)
Ye a og Yam to vead hase tength),utdthCu). kagkt() ef
parallelegYam d Calctate ts oea and Peofmeter =24

eLat s te diffe erce bla Pnpldt ty Convexsdon and erpett


ye ConveYSens?
Given stY|= Aetto",hat wll be to valg of ? Osty [ol

o hat ull h vesut given by te fol leurg i)typeô+) 5)type(6-)

n te tleuing expeSsots Tn py thon [ foY s1t() use mth Srt

D Nkat utll be t outut t Poput fer both the Statem ant s F/2
6:sfput/valu )

B Folleng Cede §an epeston wth all rtegey Valts w Tstho


\esut n floatrg point term? a,bl= 2,3,6
d=atb* Cb
Pínt ()

pestct te cutput f e is gien fpat as hr'


a
bzo45
PYÎnt (oz=b)
Yt Casb)

d- Sty Cb)a69

PYint (cs
e-Tnpt ["nt)
Prtnt [c==e)
,Corplex
, Tntfloat , boolean
2, 0,| Can also used în Booleon, TYul,,false. Bool C) Can be use

3, /4 = 4 olD=l
(4)4 =4. 26 o/p=4
13

Rarman-parman

5 b+(-3)4 25 >642-(-3)*Eh

24>165

op -2>165 FalSe

b, 8.625 8 8625 a.625 B.625 3


4 1=tnt(hput('Enty ength))
w=Tnt[rput('Entey ufdth)

hatrt(tnput('Erter \8ght:)
Prtntlare)
Pint(Pei)
8,
Yplicitdtde Tmpltcit
* Whon we Convert a datatPe when the CompileY ConveYted
nto anotY by Jyrtakdotatyfe automaliCoally from one datotype
to onothY
*Fg:înt(6/3) o/p:2.0 6.0

9, Givenstr [oJ=H )sY]=! )sY =e )str L-J=H 5) StYJ=N


10, a) class 'int'> b) 2class> c)L Class 'i>
d)<Class 'tloot'> eOo6s'int'> )2class'int>
, ) b= lo, h 6 b)Y= 5,h=
exp= *b**yh exp-1*3.)4*y**th
PÌ nt[exp)
iMpoA math X, =lo,)=12, =5 t +
math.s t s-L)*t 2+Ct)**
Prtnt[3)
Pînt lerp)

Value 2

13, d248*6/3
d= 5*2.0

voa must be foot


Becau se fn noymal divislon the yeturn
15, FBnd 4 eorS

PY?nt Cnae)

Pintnomc
b) a=bool Co)
b=booll)
Pr? nt (o-false)

)nt (ypeCtnt "23')


PYint [tyne BtY C'123.0))
d) Pint"He lto" /2)
PtntCHelo") 2)
) stY object does not
jupport item assiurt
b) folse fs not
dotNd-id you mean 'Folse'.
) We Conot ve sti1g fnside an
irtegr tera
d) We Canrot divide oY perfoim
othmett ogevatien th
with
sthring and Trdegas.
)

ncinlinput (" Ertax anum:)


#lnco):

else:

C=yat-n

You might also like