Recreate the pokemon table using All rows at once on the documentation:
All rows at once
When you have a list of rows, you can add them in one go with add-row:
x.field_names = [ "City name", "Area", "Population", "Annual Rainfall"]
x.add_row(
[
["Adelaide", 1295, 1158259, 600.5],
["Brisbane'', 5905, 1857594, 1146, 4],
[ "Darwin", 112, 120900, 1714, 7],
["Hobart", 135, 20556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Penth", 5386, 1554769, 869.4],
]
)
x.field_names = [ "City name", "Area", "Population", "Annual Rainfall"]
list1 = [
["Adelaide", 1295, 1158259, 600.5],
["Brisbane'', 5905, 1857594, 1146, 4],
[ "Darwin", 112, 120900, 1714, 7],
["Hobart", 135, 20556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Penth", 5386, 1554769, 869.4]]
for i in list1:
x.add_row(i)
Comments
Leave a comment