ex 3.2 a
This commit is contained in:
parent
e0a8cea2c4
commit
830bca82c4
5
tableformat.py
Normal file
5
tableformat.py
Normal file
@ -0,0 +1,5 @@
|
||||
def print_table(objects, attributes):
|
||||
print(*("{: >10}".format(attr) for attr in attributes))
|
||||
print(*("{:->10}".format("") for _ in attributes))
|
||||
for obj in objects:
|
||||
print(*("{: >10}".format(getattr(obj, attr, "")) for attr in attributes))
|
||||
Loading…
x
Reference in New Issue
Block a user