Python Programming Project: Data Analysis and Algorithm Implementation

Verified

Added on  2025/08/11

|9
|453
|148
AI Summary
Desklib provides solved assignments and past papers to help students succeed.
Document Page
Table of Contents
Introduction.........................................................................................................................................2
Sonnets.................................................................................................................................................3
Pseudo-Code.....................................................................................................................................3
Code..................................................................................................................................................4
Output..............................................................................................................................................4
Doublet.................................................................................................................................................6
Pseudo Code.....................................................................................................................................6
Code..................................................................................................................................................6
Output..............................................................................................................................................7
Conclusion............................................................................................................................................8
References............................................................................................................................................9
Table of Figures
Figure 1 Sonnets Code...........................................................................................................................4
Figure 2 Sonnets Output- 1....................................................................................................................4
Figure 3 Sonnets Output- 2....................................................................................................................5
Figure 4 Doublet Code..........................................................................................................................6
Figure 5 Doublet Output........................................................................................................................7
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Introduction
The assignment is based on the solving problems using python. The assignment tests the
skills with respect to the python language. The assignment requires python script which is
based on the problem solving principles. The script will include various functions which will
be responsible in fulfilling the requirements of the assignment. The functions will include
reading of two different files, processing them and producing desired results according to the
assignment requirements.
Document Page
Sonnets
Pseudo-Code
Read the respective file using python
Strip() function is used in the file to read and saved in a variable
Two empty lists are created
Data is appended using for loop
Isnumeric() function is used for differentiating between the numeric and non-numeric
values
Another empty list is created to append the data
Dataframe is generated for one column
All the characters and numeric values are read and stored in a variable
Length of all the variable is counted
Then it is stored in a listed and printed using dictionary
Document Page
Code
Figure 1 Sonnets Code
Output
Figure 2 Sonnets Output- 1
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Figure 3 Sonnets Output- 2
Document Page
Doublet
Pseudo Code
File is read
Case of all the words are changed to uppercase
Range() function to find the length and the product is yield
The values are appended
The values are stored in a list
A function is called to find doublets by changing the index of strings one by one until
desired output is achieved
Code
Figure 4 Doublet Code
Document Page
Output
Figure 5 Doublet Output
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Conclusion
There were various functionalities which were included in the script. The script was based in
python. The requirements were fulfilled and all the criteria’s were achieved. The assignment
included reading of a file, counting the appearance of the letters and displaying it to the user.
The assignment also included the function of finding and displaying doublets according to the
pair of words provide in the assignment requirements criteria. The testing was successfully
completed and the script was running bug free. The proof is provided in the report.
Document Page
References
Chapman, C. and Stolee, K.T., 2016, July. Exploring regular expression usage and context in
Python. In Proceedings of the 25th International Symposium on Software Testing and
Analysis (pp. 282-293). ACM.
Grus, J., 2019. Data science from scratch: first principles with python. O'Reilly Media.
Hunt, J., 2019. Collection Related Modules. In A Beginners Guide to Python 3 Programming
(pp. 401-406). Springer, Cham.
chevron_up_icon
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]