preview

Pt1420 Week 4 Assignment

Decent Essays

Journal 4 This week’s assignment involved understanding how functions work in the context of Python. The programming assignment is the most useful part in this chapter as it allows me to practice some more on programming Python. While working on the assignment, I was trying to think of the most efficient way to write code for this assignment, and I ended up defining to additional functions in addition to two functions required to complete the assignment. The first function tells Python to print one blank space. The second function tells Python to print three blank lines. Then, I combined the two function into the two required functions for this assignment. I started to understand how a well-defined functions can be used as a building block for other part of the …show more content…

Furthermore, as mentioned in the text, it becomes clearer as to why making adjustment to only one function is less time-consuming and more efficient when I need to debug the program. Additionally, I can see how this minor detail makes debugging possible. I think it is important to keep this fact in mind when writing code, especially when working on a large project. Besides the usefulness of a well-written functions, the purpose of comments in lines of code become clearer to me as well. Similarly, the programming assignment helps emphasize this fact further. When a functions is defined, it is created to serve a specific purpose, and it is a good idea to leave a brief description that explains its purpose so that you can refer to it at later time. Just as the text explains, I totally agree that comments add the human elements to the script and that they are extremely useful when multiple people are working on the

Get Access