Python (Assignment 1) Shubh
Python (Assignment 1) Shubh
Asignmnt (Unit 4)
Sectien -A
hat ae the main featuea of fythen ?
The main atunea g pythen ant
c) Easy to Leanm ())Fxtensue featune
D fasy te Code (vin) High Jkusel iaiguage
Sntrjhactet iangageN) Datakas. sot
prcgam
iw) dhct ariented l) Lazge sndard library
LC)Cus platkenm on) Dynauc Tyjed angage
pueu afan jintnadtùle shellin Python9
2 lhat i The plee
> The pythen ntnactiu Ahll preucles proqammi
qick ay execute cemmand and tyQt
n tet code ithoutcating a fle
3 Gplaisn the imþartance of centation in Pthen 9
Pyttuen inndentatin i a uay tillig a Pytnem
mtabtn that Thu greuyb af statunias belongs to a
prticulan block coda A block u a cenbinatien
6 al theeestatesmemt
Sduntity afexates.
both ti checta
andhar the Sme mmDy docahen
5. uite a
Rytnen scipt that
Amputnd pinta a prrienaliged elcemeeinage
PAGE NO.:
DATE:
name)
ame.inhut C Enter your
your
print Welcome",name)
nomesShubh
Qutput Enter your nor
Welcome Shubh.
Section-B
llhat anu the basic featue o yM prgramming
language? Explain hu prozes f editing, sauing
and zumning a
Tha baic feature o ythen prcgaanamng danguage
fordalle language Stncancl lilbray,High-laual
Languagt, kay to leann amd uit, Byananue Janguag
Extinaible language and ntujuiBecl langage
Th pxcziLi editing sang amdnninga futen
BCibt m a text editor 6a IDE:
4fditingu pythen scibt
nw file ar efen an exiting Pyten scut
pite luith a'-py'extencien)
LAlute edlt ewr pytnen codle mthe edter FrUTe
Hnat te code ieceuclly lenmatted, indudng
preper ndentatiom
Stutemeta in Pythen:
Sn pytLteatatenntnt jsan mtUten That
Pytun threter ca execute. Thine ae
Aiiqnnnt ztatenins
cenditienalatateasunts Loeping statiment ete
teken laanactr NENLINE sed toD p d a
statumunt in pytiucn Aigilin that each line a
fytuen scubt containi a Atatemeat
Exanble: # Statement
print ( Hello tortd')
StateNennt 2
# Statenent 3
(x)
print
Cutput: Hello world
206
ebrexiena in Pytnen
ia a combmaton s cpenats and
openans Ihat tnpruttd to prcduce &tm sta
Vaue
Eane:
print (x)
Gutputl6.3
3 (a)lite a prcgaamm im pythen that accpts tue
numbers em hu seeand dicphy: hin
sumy
mctpcduct and quctient.
diylay uaus beferu suopingand altn
a= int input ( fnter first number ))
bmt Cinbut (' Entcr Secord number ))
print CSun ab)
print C Difitrtnceni
peint ( Product , ab)
print CQuotient " a b )
Q A
print C The. Valie of P alttcCAwaphiag )
print C' Ihe value of.QatttrAuaphing)
Cuthut:Pltase enter.valvefor P: S
Please enter volwe tor
The Nalue of before sw apping 15
The yelue af @befateduobing2
The volue of P afterauiabping 2
PAGE NO.:
DATE:
Exaable'
print ("Tþe ot a"tta
b=5-0
prigtTyhe ofbi"tye
Cb)
print (" Ty of e tyþe Co))
Outht: T4be of a' <class int'>
Tpe ofbsclass Alaat'>
Tape of c: <clasCemplec>
HD Sequnte Data Type The siquemce data type
jmpsthtn thu ordiud coLleche ulan
dillered data typu Sequsrcealleue stel
ogaiged and
Thee
Fytnen:
String Shring
Shring
pestathng umicode
m pythcn ae anay
clanactere Asting
bytes.
a
DATE:
Ccloss bool
< class bool
Neme Error namne'false' s notdefineA
Nax(A2')
) math:log Cl6,2)
oulput
G math:cosmath'pi)