0% found this document useful (0 votes)
77 views5 pages

Python Programming Home Assignment Guide

Python textbook

Uploaded by

dishabarnwal42
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views5 pages

Python Programming Home Assignment Guide

Python textbook

Uploaded by

dishabarnwal42
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

YASIIWANTRAO CHAVAN MAIHARASHTRA OPEN UNIVERSITY, NASHIK

(Estd. By Government of Maharashtra)


Dnyangangotri,Near Gangapur Dam, Govardhan, Nashik-422 222
HomeAssignment

Academic Year - 2024 -2025

Code PI3t- B.C.A.(with Distance Education - 2016 CGPA S.Y.B.C.A Semester Iil
ame of theProgramme& Prou Credits) - -

0
P131

1ear/Semester |S.Y.B.C.A /Semester III

Nane of theCourse & Course Code Python Programming (1CTI52)

Name of the Student BARANWAL DISHA OMPRAKASH

renmancnt Registration Number 2023017000417295

Regioal Centre
[Link] UNIVERSITY REGIONAL CENTER MUMBAI & 3139A
isbile Number 9511263931 E-mail ID dishabarnwal42(@[Link]

Name ot theStudy Centre & Code South Indian Children's Education Society's Arts, Science of & CommerceCollege,
Ambarnath & 35201
iHte of Submission
Noof Pages
eneral IustruCtions
Hlome assignmeni is useful for self-analysis of your preparation of the final examination and progress
Readall the questions and their marks in the home assignment carefully understand the Definitions and concepts properly
Rcad carefully thc text, syllabus summary
and related to home assignment.
Donot copy the points. matter from the text while writing home assignment mentions your one point /lopinions whenever necessary
Your answer should include how you would apply the knowlcdge in real life situations
Usc A4 size lined papers for writing home assignment by taking printout from this file only
iteeach new answer on a different page.

oted or typed answers are not allowed


The marks of Home assigmentand corrective instructions will be sent after checking homne assignment
Present the Home Assignnment by following the instructions and rules. Read carefully allthe instructions and rules betfore any
correspondence or cominunication with the university

For cach theory course of 4 credits its carry 30marks, there are Two Home Assignments:
i) HomeAssignment 0i (HA01)is of Twenty marks consisting of 2 Short
Answer Questions carrying 5 marks cach and I Long
Answer Question of 10 marks.
)Fiome Assignment 02 (HA02)is Tenmarks
of consisting of total 10 Objective Type Questions (MC)carrying I mark cach.
For each theory courseof Only One
2 credits, there is Home Assignment of Fifteen Marks consisting of Short Answer
1
Quesion of 5 imarks and Long Answer Question of 10 marks.
1
3 Student haveto write the Home assignment 02 (MC)on separate page. Home Assignnment 02 also to be uploaded along vith Hoe
01.
assignnent

Student Signature
3YASHWANTRAo HAVAN MAHARASHTRA OPEN UNIVERSITY,NASHIK Ppe4
PRN: 023017000417295 Course Code: ICTIS2 StudyCenter Code : 35201

NO

Q Explaùn
Pns LISTS
hoo ans Ae ditlesent fram I1a41 in pytton.
1. Dynaic se3 ist can grow or Shaiok dnyamially
elermen3 ane added onmorrd.
. Lutstoe ele men oL dilfenent daa

B
Hetroqenous i
pu'such au Ahings
In'se tioo and deletoo: 1?s
can

,
otged kloat and othes liss
Suppot fnseion and deleton
of elemen5 anyt pos?ion.
4: Implemeohd as lioked 1?sts Liste ane Gmplemenhd as linked
1iss, wwhich allow Aor cf4iieot insatioo and deleton.
ARRAYS
1. Fixed s? ze rays hare a ned Size, whch u detymined
2ation 4mne
R. Homogen ou) Can only Stor clementt the Same
rrrays a
data type.
3- best acces i oras povide haska accy to elernents
as they au sto ed in Conquous memory locatio
4. Implernentrd
au conhquous
a contiquou
blocks o
blšekuiPrrays are
memoy huch
implementrd
allog or
bastea

kEY
. OIFFE RENCES

S?ze 4lexibily
List cao qou0 or shaink dynamically
hihile asays have a Hxed <ite

Q. Data type flexibil


LBty 3
Can Stoe elementy ot dihheent
Aypes,while
Sarne data
ays
ty pe
Can only Sto ele ment OA the

[Link]

Iile Arays províde hastr acces to eleme ot


lists qeoenaly slowe due.
due to
to
thiindynamc
natut

Student Signature
VASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY,NASHIK PapefU
PRN: 2023017000417295 Course Code: ICTIS2 Study Center Code : 35201

[Link].

bat i iequla ex wits example.


Qne task of Seanchng euprsesaciog
plaùn

that python ha vexypowexfuT fbrasu


Megula expresio ttat handles many 0thete
mar
ta i quite eleqaoty Regulan expeion.
cumosF theim 'own l1tHe pDramm nq lanquage
ho Secching and pansing shngs. Afa må4
bact ente booke bar ben writeo oo the
-talte o, hequla expionu:
equlas expuston 1brany
unction. The Gollowing
demonshate a J Se o the Seanc Ronctto.

# SeaIch for inel that Contaùn

import
hand =open C'mbox -[Link] )
Bor

1
ine'

ne = line
re. seanch
.nship
Cbrom
), bne ):
priot Ciine )

Student Signature
23 YASHWANTRAO CHAVAN MAHARASHTRA OPENUNTVERSITY,NASHIK Page of 4
PRN: 023017000417295 Course Code: 1CTI52 Study Center Code : 35201

ONO.

3. what u slidng ? Explain with example.


Ae ahng
ot
steing a tchoique uUsed
sed to
to exhdct Subset
a

dhaaete om you to speciy


to exbractmaking
a Nage of chaxaetou
powufol tool
oal or manipulaRng sing
H Segment ol a shing u called sltce. selechng
sitce ie cimilas to selectng

Mont
pint then
>>> p'rint Cs[G:127)
python

Phe operator netuni the paat ot the fromthe


hanaet the to

he fimt but eKeluding the last


Omit the Sist index (behom the coloo),
I
the se
yoU
dt the
baninng
the
o

shing,
9 you omit the Second th sltce
gee tothe
Sring
>>> muit = 'loanana

ban
>>>
'ana

L he ist index qotat than or eg ual to the second


the heult nphy skring, nepoeaenkd by two
Yuo tatoo mak!
>>> Auit = banana
1
> uit [33]
An emptyString. Contas nochoyats and ho
leng tho, but oth than that, iF the Same
any othe shing

Student Signature
9YASHWANTRAO CHAVAN MAHARASHTRAOPEN UNIVERSITY,NASHIK Page.

PRN: 2023017000417295 CourseCode: ICTI52 Study Center Code: 35201

[Link],

G4 How ead and wntte and updak the fale în puthon ?


Explajn olth ewample

oeaig
the open)
Sile' To

fan ction
sead
in uead mode
you

5le'= open 'exdmple trtF, )


o Dtn'= legead )
print (coneot)
Bile clote )
wriing Ble:
o wrie aa fyile in puthpn 4au opeo funtton
an example
le

file-uye Hello word|3

updating

updet mode open()


append an
eample
ole Opep Rmanple. ttt ta
wte(n This an updated (ine)

Student Signature

Common questions

Powered by AI

Lists are implemented as linked lists, allowing efficient insertion and deletion operations but generally resulting in slower access to elements due to the non-contiguous memory storage . Arrays, on the other hand, are implemented as contiguous blocks of memory, providing faster direct access to elements but requiring the data to have a fixed size and homogeneous data type . This contiguous implementation allows for better performance in element access compared to lists .

In Python, reading a file is performed by opening it in 'read' mode, allowing for the extraction of its contents . Writing to a file entails using the 'write' mode, replacing the existing content or creating a new file if it doesn't exist . Updating a file can be handled in 'append' mode, which adds new content to the end of the file without altering the existing data . Each mode provides different ways to handle file contents, catering to various needs in file manipulation.

String slicing in Python is a technique used to extract a subset of characters from a string by specifying a range of indices . It allows the selection of a segment of a string, much like selecting a segment of a list, which is useful for manipulating substrings . For instance, 'python'[0:4] would return 'pyth', extracting characters starting at index 0 up to but not including index 4.

Lists in Python can grow or shrink dynamically, whereas arrays have a fixed size determined at initialization . Lists can store elements of different data types, such as strings, integers, and floats, making them heterogeneous. In contrast, arrays can only store elements of the same data type, making them homogeneous .

Python's regular expressions can handle complex searching and parsing of strings by defining a mini programming language for pattern matching within strings . They allow for sophisticated searches using expressions like re.search(), which identifies specific patterns in text files, showcasing their efficiency and elegance in textual data manipulation . This feature enables tasks such as searching lines containing specific substrings within a text file and can be extended to more complex parsing activities.

You might also like