I want to display variables in table format that should be perfectly align in python : <p>I want to make a table in python</p>

<pre><code>+----------------------------------+--------------------------+
|               name               |           rank           |
+----------------------------------+--------------------------+
|                {}                |            []            |
+----------------------------------+--------------------------+
|                {}                |            []            |
+----------------------------------+--------------------------+
</code></pre>

<p>But the problem is that I want to first load a text file that should contain domains name and then I would like to making a get request to each domain one by one and then print website name and status code in table format and table should be perfectly align. I have completed some code but failed to display output in a table format that should be in perfectly align as you can see in above table format.</p>

<p>Here is my code </p>

<pre><code>f = open('sub.txt', 'r')
for i in f:
    try:
        x = requests.get('http://'+i)
        code = str(x.status_code)
        #Now here I want to display `code` and `i` variables in table format 
    except:
        pass
</code></pre>

<p>In above code I want to display code and i variables in table format as I showed in above table.</p>

<p>Thank you</p>
