Join Barron Stone for an in-depth discussion in this video Formatting table rows, part of Code Clinic: Python.
- This final video will explain how to create row function,…takes a list of row elements,…and generates the code to put them…into either a standard or header table row.…The first line of the function retrieves the optional…keyword argument for the number of leading spaces.…And this works exactly the same way as it did…earlier in the create_table function.…The next line begins generating the output string…by concatenating the spaces in front of a new table row tag.…After that, an if-else statement checks to see…if this is a header row or a standard row.…
If it's supposed to be a header row,…then we cycle through every item in that list of row data…that was passed to the function and concatenate a new entry…on the output for an item enclosed in header tags.…If it's not a header row, then we're gonna do something…a little bit fancier.…I will admit that this else clause here is written…very specifically to match the formatting used in…James Williamson's video in the exercise files.…In James' example, he formats the left-most column…
Barron introduce challenges and provides an overview of his solutions in Python. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Visit other courses in the series to see how to solve the exact same challenges in languages like C#, C++, Java, PHP, and Ruby.
Skill Level Intermediate
Problem One: Exploring Lake Pend Oreille
Problem Two: Image Analysis
Problem Three: Eight Queens
Problem Four: Accessing Peripherals
Problem Five: Recursion and Directories
Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.