Aktywne Wpisy
![Defined](https://wykop.pl/cdn/c0834752/14c97220de8fb1d180a08613bf8e0a7f24dd6e8064ca336d2f2c5af2d9ef2589,q60.jpg)
Defined +9
Dobra, tak, to ja # pokazmorde
Rano usuwam
Rano usuwam
![Defined - Dobra, tak, to ja # pokazmorde
Rano usuwam](https://wykop.pl/cdn/c3201142/4bb4a9f622aa5b5d45d0eb0fc7455e2b6d5b91eacf2216f09f0a64b07078731b,w150.jpg)
źródło: temp_file906591300613076175
Pobierz![Itslilianka](https://wykop.pl/cdn/c0834752/1060e06d466353d6cab4d161fa89b29edb0477489892df94112b0e2d757d071d,q60.jpg)
Itslilianka +28
Co dalej chłopaki bo nigdy nie doszedłem do tego poziomu
![Itslilianka - Co dalej chłopaki bo nigdy nie doszedłem do tego poziomu](https://wykop.pl/cdn/c3201142/9b8eb2f2ead96ded5f177570a5ad67cc113a4ea7261bc5c13081d6401ebab4ae,w150.jpg)
źródło: temp_file7404621288198178655
Pobierz
Write a function named printTable() that takes a list of lists of strings and displays it in a well-organized table with each column right-justified. Assume that all the inner lists will contain the same number of strings. For example, the value could look like this:
tableData = [['apples', 'oranges', 'cherries', 'banana'],
['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']]
Your printTable() function would print the following:
apples Alice dogs
oranges Bob cats
cherries Carol moose
banana David goose
#python
#programowanie
tableData = [['apples', 'oranges', 'cherries', 'banana'],
['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']]
transpose = list(map(list, zip(*tableData)))
def printTable(table):
[print(" ".join(x)) for x in table]
printTable(transpose)
for i in range(width)
.for k in range(height)
..print(table[k][i], end=" ")
.print(nowaliniaxD)
tableData = [['apples', 'oranges', 'cherries', 'banana'],
['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']]
def printTable(table):
....string = ""
....i = 0
....tableWidth = len(table[0])
....tableHeight = len(table)
....while i <= tableHeight:
........for n in range(tableWidth - 1):
............string = string + table[n][i] + ' '
........print(string)
........i += 1
........string = ""
printTable(tableData)
Tak żem to zrobił, po Twojemu nie działa ale nakierowałeś mnie, dzięki ;)
I jeszcze miałem wyrównać do prawej
https://paste.ofcode.org/RxWn47SyQehyWCL5Rip8EC