Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
34 views
Python Assignment
Uploaded by
kikira9465
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save python_assignment For Later
Download
Save
Save python_assignment For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
34 views
Python Assignment
Uploaded by
kikira9465
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save python_assignment For Later
Carousel Previous
Carousel Next
Save
Save python_assignment For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 27
Search
Fullscreen
ASSIGNMENT Subject Code :- BCA-DSE1.1 Name of Subject:- Python Programming Course :- BCA Semester :- 5th (School of CA & IT) ‘Submitted by:~ Submitted to: ‘Name; Sahil Singh Name:- Mr. G.D, Makkar | no:- R210529054 iACKNOWLEDGEMENT Tam deeply Srateful to my professor, Mr. G.D. Makkar, for their invaluable guidance and mentorship throughout the completion of this assignment. Their expertise and feedback Steatly enriched the content, and their dedication to fostering academic growth has been a constant source of Inspiration. T would also like to extend my appreciation to my fellow r Classmates for their collaborative spirit. Engaging in meaningful discussions and sharing ideas with them not only enhanced the quality of this assignment but also made the learning experience enjoyable and intellectually stimulating. Lastly, I want to acknowledge the unwavering support of my family and friends. Their encouragement and understanding provided the motivation needed to persevere through the challenges of this academic journey. | am thankful for their presence in my life, which has been instrumental in my success.“a T | _ |Pageno.| Sign | 5 ESS Analyze the differences between alist anda 4-6 tuple in Python? \ i rs a Evaluate the trade-offs between using various functions of inserting elements(s)inalist? | \ 3 |Illustrate list slicing to extract a subset of elements from a string 4 |Show how to use the sorted() and sort() | a Fe eeisane to sorta list of numbers in ascending | '"~” \ \ Va order 5 [Compare and contrast Python's for loop and | Hist comprehensions for creating lists. Provide. | 12-16 \ ‘examples e ae See 6 [Analyze the concept of short-hand Python's yyy | conditi al statements? | { 7 |Analyze the behaviour of functions that return | ; \\B-20 | multiple values? oe 8 [Develop a function that removes duplicates lg De items from a list while preserving the original. | VR order a sali aan 9 Explain in detail the concept of function parameters with example? Demonstrate set operations (unio! ection, difference, symmetri n, ic difference)Ql. Analyze the difference Ledaeon 9 Jrq ; ee ou. “— ’ MS:1. Multi > + lists. Lege ee \ \ ’ > f Co ’ nel . > * Tuples : 4 > > J > \ ; e , ; 3 a i elists list ore defn % Using Safvare bracki += 11,234] 0 * Tuple: Tuples ove defined by 400 ways (9) Using Fasontheses ‘Ly eg my-upke 0.2.32 ae (i). Wwhttout using PoronthesesS. Pox eMance licks ore general because me 4 Use Case slists : eTuples :J My \ ° becouse cf ther at \ite Use of thet 4 de TORETCESELERELL SA B2. Evoluole te ade-offs bekveen using various Functions ch inserting elements) in @ fer? Ans. ). Appen dd Funclonalt ty « Tt + Trade: fs: \} Lo you want +o & Yoo nee tan be 2. Extend) * Functionality: The exe Clement ndl) foncken oddsCOCCI IIIT III 00 3. InsevtO): Phoneionality : i, di) »* Teade dh: lov) 4. Loncodenortion (+ opera - Fonchonalita + You F + Tt crtotes a nevd fre Trade -ofs Mince tongue Move Memore¥ S S = Ss S = a) a) Ss a - oT ee 5. Shee Assignment * Functanalt/4: You can vse sticing Position Ly Y ‘ fred ntvol tam »Tyode- dfs : T+ pre dir 3 ting mulliple eloment veal 03. TMostile Itt stetry + extet a subset of men 4 with shing in Ans ) chayatte) fron EW { { , )iyehotion how to ose Tish the hing. Here's oF vation of esheet a. elements bom Qa a subset 6 shing +e Define Shing me _shing = "Hello, World’? 4 Basi list slicing sobebng mae Shing [9 #12) srerbratt pontY AE Dmisting start ond end Index Bibbs = my-sting [8 trevtvact every, second valve bashing ) 4 Odpot "lo oll’ + Reversing a Shing Spbshing > ing sing pint (_Substing) +r Dulpks “Ldhow lel” _S\. aeReverses the enti PEER ITE INGIIIII09,Romer bey Qk Show haw 4 use the sovtedl ond sort) fonction 4, cot 0 list of numbers in ascending anlar Ans ordey fn hos o'6 + Using the ‘sortedlY Function The ‘sorledl Function xetns a new goxted fist widhrt modifiging the oviginal list. Here's on example ea Define Net d numbers numbers = £ 5,2, 9,1,5)63He Use tho sowledl) tinction to @ +e Soiled list Using the sot) Hnekion . \ ot tre a Bile a 4 numbers H Numbers =dk Use the soxtl) method 40 EB H ascending ovder numbers. Sort 44 Print the Pather's fr loop ondl ligt 05. Lomport and lovtrast Lompahensions fos crtating liste. Provide cromples Ins. Both Patton's for bons ond Vist comp shen sions one vsed tov creating \igts , bot thea hove different purpose anal vse cases Veye’s a Lomparision and convost bebween the two , along woth “he exam ple.wprthension + concise ond ee compithension s ot 0 2 yodahle 92% 35 extol sts On expeession to cath Hn pprehensi epntsorie involves ¢ rf clerronk 4 @ Syntax AeSp1 = [ sorre-opention litem) fe (em) slem fo Theweble if sernt con Exam ple LUsing python list tomprthension +o generate even nombexs p at As© Tmmuto bility ‘ \ by elena ee p| For loops ove yergable ord should be used fox ComPler los and jis!WontS Vinton s . loomplex conditions ox np|Hole statements Mays becernt fess wtadable shen condensed | Into a single \ineaaerrcceceteseeew +he behaviout wo \tiple values 2. Tuple Unpocking To cxccess fndividual volves r¢torned by o4. Tmmvtability Ap 0 Rete te g ' ttain tHedy oviginal values and 4 1 ohets i 22K And “immuTanilits C 5, Tmplicit Tople Facking, Even 4 ypu clon’ explicit cueale a tuple tn tre sttom statement, Father implity ta ds&. Eweor Handling Fonelions webu moltple valves Qroking and enpatking one eficlens making it cowinient te work oan operations , molliple attorn wolves Use Case Moltiple vetuen valves ave ustfl ushen 6 needs fo provide welaked piece o, clote7 [ p > > » » b ’ ) , , ) ' } / i \ abere finest} Defining Funedion Powomeses ae * Toxamerey! ds weet [nurne): print gy Yello, Xnarne | 5 HH name is poxamely and greet eo DaeCaling Aunctions wth Aygments def. goeet (nome- “huest”): print (F*Hello, {rare} overt) at Dulput + Hello, (nuest |Moliple Foxameleys Functions car bY, g def add (a,b) when orb yult = add (5) can pass de divdel dinderd, divisos) ! atin clividtnd/divisor aot = aide (dividend «10, divisev=2)bee ee STI ISSIILSLLZ. Ans. Sel operations fn python ort vce Various operations o7 sets. ae AE Define wo sets sed = 1,2 ,3,4,5% Sed = $45,6,4,8% 4b Union of te gots Lrion_rsplt = sett. urien (Se AE Simply using tw ‘| 0 Union végu|t—- alten 4k Under seror 4 inter sechonresulAE Difference between two sete, Aifesence —wesvlt = Sett Brox Simply ving the’ opeintor at Symebric difference berreen tuo s Atos simply using “he “P operato/ At Rind Result eaeeaiit CONS y difference — rewlt) mnmetric_ diffeente- resul i Difference ny3. Difjrerrce $ 4. Syrnmeric Difference : find elements Of ets bu snlegettion. Use “Suummedica Differeneel Sex net fn they ot. ‘in the erthex Vow '® cperator
You might also like
Python Practical 6-11
PDF
No ratings yet
Python Practical 6-11
15 pages
Python Alok
PDF
No ratings yet
Python Alok
23 pages
List Tuples Dictionaries
PDF
No ratings yet
List Tuples Dictionaries
54 pages
problem solving and python programming
PDF
No ratings yet
problem solving and python programming
34 pages
Adobe Scan 15-Dec-2023 (1)
PDF
No ratings yet
Adobe Scan 15-Dec-2023 (1)
8 pages
ASSIGNMENTpython (1)
PDF
No ratings yet
ASSIGNMENTpython (1)
8 pages
GE3151 PYTHON UNIT 4 NOTES EduEngg
PDF
No ratings yet
GE3151 PYTHON UNIT 4 NOTES EduEngg
23 pages
Odd Sem Solution (1)
PDF
No ratings yet
Odd Sem Solution (1)
11 pages
05 Lists Advanced
PDF
No ratings yet
05 Lists Advanced
40 pages
1696123699200
PDF
No ratings yet
1696123699200
73 pages
List Manipulation
PDF
No ratings yet
List Manipulation
26 pages
Week2Session5 - Lists and Dictionaries2
PDF
No ratings yet
Week2Session5 - Lists and Dictionaries2
38 pages
FALL WIN SEM (2023-24) CSE0106 ETH AP2023243000534 Reference Material I 04-Nov-2023 Module4
PDF
No ratings yet
FALL WIN SEM (2023-24) CSE0106 ETH AP2023243000534 Reference Material I 04-Nov-2023 Module4
102 pages
AI Lab2
PDF
No ratings yet
AI Lab2
28 pages
Python Lab - Programs
PDF
No ratings yet
Python Lab - Programs
27 pages
Lessons Basic Commands
PDF
No ratings yet
Lessons Basic Commands
10 pages
list_tuple_string
PDF
No ratings yet
list_tuple_string
11 pages
Lab 2-Part 2: Lists
PDF
No ratings yet
Lab 2-Part 2: Lists
5 pages
AI Labreport 1
PDF
No ratings yet
AI Labreport 1
5 pages
Py Ass PDF
PDF
No ratings yet
Py Ass PDF
33 pages
Unit Iv Lists, Tuples, Dictionaries Insertion Sort
PDF
No ratings yet
Unit Iv Lists, Tuples, Dictionaries Insertion Sort
12 pages
19BBTCS069 KrishnaKantPandey DAP Lab Record
PDF
No ratings yet
19BBTCS069 KrishnaKantPandey DAP Lab Record
100 pages
unit-4 & 5 python
PDF
No ratings yet
unit-4 & 5 python
27 pages
Sol PYTHON PROG - III Sem Question Paper (2023-24) Odd
PDF
No ratings yet
Sol PYTHON PROG - III Sem Question Paper (2023-24) Odd
25 pages
Data Analysis With Python, String, List, Tuples, Dictionary
PDF
No ratings yet
Data Analysis With Python, String, List, Tuples, Dictionary
12 pages
Aktu Sol Bcc302 2023 24 Odd Sem
PDF
No ratings yet
Aktu Sol Bcc302 2023 24 Odd Sem
16 pages
Python Lab Manual
PDF
No ratings yet
Python Lab Manual
19 pages
Unit 4
PDF
No ratings yet
Unit 4
12 pages
chapt3
PDF
No ratings yet
chapt3
57 pages
Lab-manual-Advanced Python Programming 4321602
PDF
No ratings yet
Lab-manual-Advanced Python Programming 4321602
24 pages
Python For Data Science by Akshita Sawhney
PDF
No ratings yet
Python For Data Science by Akshita Sawhney
18 pages
Lists
PDF
No ratings yet
Lists
45 pages
Python Sort List. The Sort Method Is Used To Sort The Elements in A Specific Order I.E
PDF
No ratings yet
Python Sort List. The Sort Method Is Used To Sort The Elements in A Specific Order I.E
9 pages
Lab 8 - Submission
PDF
No ratings yet
Lab 8 - Submission
9 pages
Loops
PDF
No ratings yet
Loops
23 pages
SC-CER96940: "Formando Líderes para La Construcción de Un Nuevo País en Paz"
PDF
No ratings yet
SC-CER96940: "Formando Líderes para La Construcción de Un Nuevo País en Paz"
5 pages
DocScanner 25-Sept-2024 7-19 PM
PDF
No ratings yet
DocScanner 25-Sept-2024 7-19 PM
10 pages
UNIT 3
PDF
No ratings yet
UNIT 3
11 pages
Lists Defined
PDF
No ratings yet
Lists Defined
5 pages
Practical Work 02 solution
PDF
No ratings yet
Practical Work 02 solution
9 pages
Python Day 3 (2 Day Project)
PDF
No ratings yet
Python Day 3 (2 Day Project)
11 pages
SolutionOfPythonQS 23-24
PDF
No ratings yet
SolutionOfPythonQS 23-24
21 pages
UNIT-4
PDF
No ratings yet
UNIT-4
8 pages
Expt - 6 - To 7
PDF
No ratings yet
Expt - 6 - To 7
4 pages
Python
PDF
No ratings yet
Python
16 pages
week8,9
PDF
No ratings yet
week8,9
10 pages
Python Quick Reference
PDF
100% (1)
Python Quick Reference
3 pages
Python Tips
PDF
No ratings yet
Python Tips
33 pages
python programming bcc302
PDF
No ratings yet
python programming bcc302
16 pages
Unit 3 Previous Year Paper
PDF
No ratings yet
Unit 3 Previous Year Paper
4 pages
Python Reserved Words
PDF
No ratings yet
Python Reserved Words
2 pages
Python Notes - Unit 3
PDF
No ratings yet
Python Notes - Unit 3
16 pages
PRACTICAL1 Merged
PDF
No ratings yet
PRACTICAL1 Merged
20 pages
Python Handwritten Notes 1701013067
PDF
No ratings yet
Python Handwritten Notes 1701013067
73 pages
Python ? Handwritten Notes
PDF
No ratings yet
Python ? Handwritten Notes
73 pages
Programming Fundamentals Lab 6(Lists) (1)
PDF
No ratings yet
Programming Fundamentals Lab 6(Lists) (1)
4 pages
Python 1
PDF
100% (1)
Python 1
8 pages
DS Lab Manual
PDF
No ratings yet
DS Lab Manual
110 pages
Mitocw - Watch?V Srkqbloqceo: Ana Bell
PDF
No ratings yet
Mitocw - Watch?V Srkqbloqceo: Ana Bell
1 page