Python Programming Assignments: Complex Numbers, Strings, Lists

Verified

Added on  2023/06/04

|3
|539
|339
Homework Assignment
AI Summary
This document presents a series of Python programming assignments, each focusing on different aspects of the language. The assignments cover a range of topics, including string validation using various methods like `islower`, `isupper`, and handling string length constraints. Another assignment involves calculating income tax using Python dictionaries and loops. Additional programs demonstrate the use of lists and loops for calculating statistical measures like total, average, minimum, maximum, and interest on floating-point numbers. Further, the document includes an assignment on concatenating strings in reverse order using loops and functions. The final assignment focuses on performing arithmetic operations on complex numbers using Python classes and operator overloading. The document includes program code, execution screenshots, and reflection questions for each assignment, providing a comprehensive learning experience.
Document Page
Running head: TITLE (All CAPITALIZED) 1
Assignment
Name
Coures
Professor
Date
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
TITLE (All CAPITALIZED) 2
Summary
The most important lesson that I learned while doing this assignment was file handling. If
we don't do file handling, we can't store data, and all the data is present in the main memory. As
soon as the program terminates, all the data is also lost. In the final assignment of vehicle
inventory system, we are storing the data as a CSV(Comma-separated values) file on the disk.
This data can be used later by any persons or the program as and when required.
The second valuable lesson is the use of loops and lists. I am using loops to iterate
through the list of automobiles. I can then use this information of each automobile as I wish. I am
using the loops to traverse the list and then save it to a comma-Separated Values file. I am also
using these loops to traverse the list and display the results on screen.
Next important lesson that I learned is modularity. I am dividing our program into
various small methods and then integrating these methods together to carry out the overall
functionality. By the use of these methods, our program is straightforward to read and
understand. Each method performs only one specific functionality. Therefore, it becomes
straightforward to construct a program and then debug it in case of any errors by the use of these
methods.
The final lesson that I have learned through this application development is the use of
various object-oriented constructs like classes and objects. I am making a separate class
automobile in this program. This automobile class has various private variables and a constructor
also to initialize these instance variables. Then I am using this automobile class in our main file
to carry out various functionalities. I am also storing a number of objects of this class in a list.
Document Page
TITLE (All CAPITALIZED) 3
In one of the assignments, we carried out String validation by the use of various String
methods. I learnt various string methods in python such as isUpper, isLower and isalnum
to validate the input entered by the user. I have also used dictionaries in a program to
calculate income tax. Dictionaries are used to store key value pair in python.
In most of these assignments , I am also taking input from the user. I am taking input from the
users which is of various data types. In these assignments, we have taken int, float and
string types of input from the user. After taking input from the user we have carried out
various operations on these inputs to process it and get the required result.
To conclude, I am using most of the programming elements that are part of python basic
programming. I have used print statements, loops, arrays, lists, dictionaries and various string
manipulation functions in these programs.
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]