#!/usr/bin/env python3.52#Coding:utf-83#4#The main purpose of this project is the processing of strings, the simple format of the output5 Tabledata = [['Apples','oranges','Cherries','Banana'], 6 ['Alice','Bob','Carol','David'], 7 ['Dogs','Cats','Moose','Goose']] 8#The required output is as follows:9#Apples Alice Dogs10#Dranges Bob Cats11#Cherries Carol Moose12#Banana David Goose13 14#no output format, output format is all right-aligned15defprinttable (data):Str_data ="'Col_len = [] 18 forRowinchRange (0,len (data[0)):19 forColinchRange (0,len (data)):20Col_len.append (len (data[col][row) )Max_col_len =Max (Col_len)22Print("the length of each element of the list is:") 23Print(Col_len)24Print("the maximum value in the list is:", Max_col_len)25 forRowinchRange (0,len (data[0)):26 forAo.inchRange (0,len (data)):27Print(Data[col][row].rjust (Max_col_len), end="') 28Print() 29returnStr_dataF_data =printtable (tabledata)31Print(F_data)
Python Programming Quick Start 6th Chapter Practical Project Reference Answer