辅导PythonExam_201805、讲解国外PythonExam_201805 程序

- 首页 >> Python编程



class PythonExam_201805(object):

   """

   请实现此类的p1_transpose

   """

   def p1_transpose(self,srcStr):

       """

       1. 矩阵转置

       将输入矩阵转置后输出

       @param  srcStr(str) 输入的字符串矩阵

       @return (str)       输出转置后的字符串矩阵

       """

       # 补充对应逻辑

       return "result"


 


if __name__ == '__main__':

 

   testObj = PythonExam_201805()


   # 测试p1题目

   # p1_question =";;"

   # p1_question ="a;b;"

   # p1_question ="a,;b"

   # p1_question ="1,,,,,2;,,,,,4"

   p1_question = "a,b,c,d,e;f,g,h,i,j;k,l,m,n,o;p,q,r,s,t"

   p1_answer = "a,f,k,p;b,g,l,q;c,h,m,r;d,i,n,s;e,j,o,t"

   print("the answer for p1 is", testObj.p1_transpose(p1_question) == p1_answer)


站长地图