The problem with this code is No module named 'prettytable'
can you show the correct code?
table = PrettyTable()
table.field_names = ["pokemon name", "type"]
table.add_row(["pikachu", "Electric"])
table.add_row(["sydney", "Dark"])
table.add_row(["charmander", "Fire"])
table.add_row(["squite", "Water"])
print(table)
"""python -m pip install -U prettytable
Firstly you need to install this package above
$pip install PrettyTable
$python -m pip install --upgrade pip
Or try this one
pip install prettytable
or try code above
maybe you should try it in windows command"""
#you will import this package
from prettytable import PrettyTable
table = PrettyTable()
table.field_names = ["pokemon name", "type"]
table.add_row(["pikachu", "Electric"])
table.add_row(["sydney", "Dark"])
table.add_row(["charmander", "Fire"])
table.add_row(["squite", "Water"])
print(table)
Comments
Leave a comment