I'm learning Python by myself and I was doing an experiment, where I want to create two columns of data (column A and column B). However, my experiment needs calculated data. My goal is to create a data frame myself (as you do in excel), but I want to incorporate the formulas I need to get the calculated values for my data.
Would it be easier to use the print() and the escape characters required (\n for line break, \t for tab), to display a table on the screen such as the following?:
| Hours (n) | Total number |
|---|---|
| 0 | 200 |
| 5 | 6400 |
| 10 | 204800 |
| 15 | 6553600 |
For example: the formula I'm using to create this table is Total number=200x2^n

You "could" use
\nand\tbut that will become awkward very quickly. A better approach is to usethe
f-stringformatting options to align things as needed.In this example, your calculation (
200 * 2^n) is part of the list comprehension that creates the table values for printing, all in one go. The15 + 1in the range function is needed to include your stated value of 15.The output would then look something like this:
Alternative output including the number alignment and formatting: