0% found this document useful (0 votes)
3 views85 pages

Python Btech Notes - Compress

The document discusses problem-solving techniques and algorithms, emphasizing the importance of a structured approach to tackle everyday issues. It also covers Python programming concepts, including input functions, type conversion, and list manipulation. Additionally, it touches on tuples and their immutability in Python, providing examples and syntax for better understanding.
Copyright
© All Rights Reserved
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
0% found this document useful (0 votes)
3 views85 pages

Python Btech Notes - Compress

The document discusses problem-solving techniques and algorithms, emphasizing the importance of a structured approach to tackle everyday issues. It also covers Python programming concepts, including input functions, type conversion, and list manipulation. Additionally, it touches on tuples and their immutability in Python, providing examples and syntax for better understanding.
Copyright
© All Rights Reserved
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
| st 4 Tafoduction te. Pylon -— x Problem Galving, to Everyday = 4 1g. Problem Ae nA. ne ey " i. probe 13 chate cf, dilealty Ynot needs to be _} cesdued lah Ss es # People. mmelee dwaisi ond An everyday W one considered Os:-0 Solution bo. Whe pe problem we i joe dog to doy grea con] be ge _ ox least Smpartante _aheg. Gpoulds Lgp-bo. college: Raat noodle ee #1) bed decision’ id _raades Yen ee @ resources roy, et waskerdia Hence Jith isawers Xonporkant bo mole ened : a while saving tne preblem.— ___ ig Jip Ltd 15 bo solve problee * pal scl tee [ "desi “he siete 1 ey essential re a wt) Cheek whether tt sak jes the- sequiren, an ae de Nhev chebomens ont? moby! oe ie —— HT the result ta either fncomect on -unsak ~ i Wren the problem solver mush reuiew eat ~— dhinstiction tose thot they ave. core oe estab’ [Link]-auedl agai. ado. Na ) Hips. Poblm2 caala 3 ees ge soi cy blem “ay +. Problem Qdlving Strep Al gerthen i te The_ step by Sklep. procedure fovelved ta Kiguring. Conteck nis to Ony.-problert_isé called —o_Algorithey The step by-step procedure invclued. in_solving moathemabical._protslem using example _ problem, “Solving, ‘ # Algorithen_ = a_strategy "ha pp Sos swnevers tsi not aleagys.” prochiea| sie ae rea Feely epee E fiawal lols ae % Gaal & Geox $ MET ce % HT \s Whe approach Yat decks osith bute: oe dierent Bice § euliog ouk ine toe ae ¥ Approaching: this sholegy as. \he Kira method tao. attempt _ to solve any problem can be highly Hime: Consuming. So % better bo use this ekrategy a5 a Ypllowup to Yqure out the besh possible scluicns using other techniques. 4) Toayght ‘ Si a Th is something. that Gest occur. suddenly, A Insight can occu ‘Kyou have -dealt with cicailar problem, ‘in Yhe_pask. sh nok work, Sy 4# Pox finskance. knowing thal_gou have sort a particular 3 peer algebra question %4 the past will maketh tach easier bh -fpr_gou fo_selue the _similery question'ok prenent. 0 aa Pythons - Hinelude [Link] oes z Z fiir) cli Pa —_ 2 B= 90 494 = ae ee ae adds oth y 2 t =) spriat 3 %]-9-9095 (Practical) I Coamand Lidtifpe Execution + phon cpteginiinasielpy — 1 Deihmalic Operations using, Pylon 2 Voz inpai (" Enter Heads”) i run laid (baal dain a input (Enter No-2:?) a= int Gnput (" Entey No.4 2” brs alo * bh 2 Priel ("Reick iargle a se butt oo Gnput . Entel Elis Circles) Circle = B14 Foyt se pant C Aven, of Civcle 2” cirille’) *, Using Anese Lae te sane “ge = Sot Copa Enter our age +” —§ 1k one >=18 2 + sprint a ore Eligible ee Makisg??)_ = a a rica ore nok Eliglible lpr Voki + To yreatey No. 4 Bellas os tot Ginpht C Enter No- ot baring s b= intGoputt Enter | 2 aa Lu 1 -s iko>b: Sle | a print“ Number”, alia ibis greta Wade, 6) ——- fe . _[eloe ss: 55 eens oe _— pink Number * ia greah: Pai bate 4 a ua = fot Ciopakt Binkés oHhaiaetl cia Bey inh 2 2D do doe Ant Cinpk Marks obtalines| to PY) p= ok Cimpul C Marks clined in’_Physies 3 |e = int GnpakC Marks , eg fo) - b= ink Cioput . Ma aban neg 9) a [total = cimipic Hue, ae ie = eg, total) fiat 4 cig \, ]500 3 (00: Ty “SS print C Percentage Oblels i per > sees eli per.72604 > per) priat CF Bistindiont#”) prio’ CA Fiya} Cloag4*”) elik per >> Bo: i ae print C44 ecard. Class #”) eli, per AO’ : prinh i #* Higher Second Class ®) else * print CA* Fail * #7) ee * Python Tnput Funchion 2 : +t The ‘input _hunction ‘ig _use to accept’ doko: from _usex 4 Syntex t input (grompt) prompk is _a_shring message which display fpr user * Python, type conversion & type casting * H#_ The “process fof. [Link] type ddato: nto another! datatype 13 called hype conversion * Types % Conversion * 4) Implicit Type Conversion: a ae Python oakomatically Jeonverts’ one hype A date os anothet. Tk doesn't needeany user Involvement - 0, here python auvoidsitloss. of” dats. 210 bo h-8 ans=lot4:5 s __ ial (Add :”,an3) a q =. . a = 3 a & Membership. Operator t # Qython supports two types. al, merdoex shi ey oe e & not inl : i # This type ch operctors beaks for membership ‘ino se rar such a5 sting. list ox hugles ve 0 eal ; ; s 4)_in operator + 5. The operator ssetuens true i} a variable 19 foun yn the | specified sequence _& folse ii nek 2 2)_nok in operator % a a i s i Mhe_operatoxaekurns lme ih o Veriable ta nok found Torte spetiljed.. aenuencésBi false hh lass eg: iu ‘Orange | Oukpaks print C Grapes in x) __“rue <== i prio Wino? to) False — print C Grapen’ not io. x) False xl Taectitg Doerchor 2 — aed Python supparts two types of identi operchors . This_operator a : intents ms object | veriables = _|_ compere eS _themeny s “Al olde eae ", cperacts sf volues on bah sides_s} the ___opetatoxpoicting to the ame inject & [alse_olhensise ~FRetatens ue i the ween on hath sides ch on __ operator _doea_not point to tne same object H Jolse olherinise —— | Oulpals balse ; Fre Prink (xis y) Fase Priok CX 97) Prink x a Note] dares of. Variables tse= idea) K| Operstor Presidence t "). Exponestiation t: mathematical operate that raises’ a. ——Sumbber_ts the power at aosthex numbex = a 1 ## Sy mba + Unomy bikotse not), plas: 4 cries 4+ taiigilion sion loot division 2 ee boshbaie ere oka “AND. So od np HA Bibvotse XOR 8) Comparison. Operatns stale —2_ 5S —+ 2 ) Tdentit } Operator 9.2 iat" a a ie ee Operator : , (ae ® gotin® operator, || Helle __ Helle» Hello | nue = ink Cinput C'Enter a number +”) Oulput : Th will prink. summation of no:s_ffern fog. @ Lachorial oko = 8 n=5 —¥ eae + tack =} while _i<=n* — 4G packs fact ao reilt print Chock), Output pe 420° f 2 dedi 3) {0 print fackowiall of nos keer 4ofe nas. ae for¢-in range (1,6)% re a es or Nain imrange 5 442 ait backte mee print (fact) > eee ee print (i, end="") O/P = doaus5 --€9- Eved’ ‘no.s pr ‘io range (9.,11,2 ascites eer rT ee “<4 be {in range (1,6) + print 1) — prit CoNia is: else”) Sa list s | HEA tick 95 ordered ‘hems. a " i

You might also like