String Manipulation Project — Python
Okay, I got it. I did need some help from the Googs, but I figured it out.
If you’re wondering what I’m referring to, it’s the Chapter 6 project in Automate the Boring Stuff. I wrote about the chapter here:
I wanted to include the chapter project in that story, but it was taking me a while to sort out, so here we are.
For this project, we needed to take a nested list and find the longest string in each list to know how much to pad the words to make a table that looks nice. The instructions said to use the right justification method, but I thought the left looked nicer. I’ll show both down below.
The justification methods are rjust(), ljust(), and center(). They justify text to the right, left, or center respectively. One could also add in a character to place on the empty sides of the justification. For the project, I used a space. If I used a ‘=’ for example, it could look like ===Hello=== with center justification.




