how to print tables using python
please subscribe my channel - https://bit.ly/2Me2CfB
t = int(input("ENTER THE NUMBER : "))
for i in range(1, 11):
b = t * i
print(f"{t} x {i} = {b}")
how to print tables using python
please subscribe my channel - https://bit.ly/2Me2CfB
t = int(input("ENTER THE NUMBER : "))
for i in range(1, 11):
b = t * i
print(f"{t} x {i} = {b}")
python print table
Using format() function to print dict and lists
Using tabulate() function to print dict and lists
texttable
beautifultable
PrettyTable # pip install PrettyTable
1. Unformatted Fashion
## Python program to print the data
d = {1: ["Python", 33.2, 'UP'],
2: ["Java", 23.54, 'DOWN'],
3: ["Ruby", 17.22, 'UP'],
10: ["Lua", 10.55, 'DOWN'],
5: ["Groovy", 9.22, 'DOWN'],
6: ["C", 1.55, 'UP'] }
print ("Pos,Lang,Percent,Change")
for k, v in d.items():
lang, perc, change = v
print (k, lang, perc, change)
2. Formatted Fashion
## Python program to print the data
d = {1: ["Python", 33.2, 'UP'],
2: ["Java", 23.54, 'DOWN'],
3: ["Ruby", 17.22, 'UP'],
10: ["Lua", 10.55, 'DOWN'],
5: ["Groovy", 9.22, 'DOWN'],
6: ["C", 1.55, 'UP'] }
print ("{:<8} {:<15} {:<10} {:<10}".format('Pos','Lang','Percent','Change'))
for k, v in d.items():
lang, perc, change = v
print ("{:<8} {:<15} {:<10} {:<10}".format(k, lang, perc, change))
print tables in python
# Multiplication table (from 1 to 10) in Python
num = 12
# To take input from the user
# num = int(input("Display multiplication table of? "))
# Iterate 10 times from i = 1 to 10
for i in range(1, 11):
print(num, 'x', i, '=', num*i)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us