哈,这个系列是跟小肉镊菹告伙伴一起组织的Python兴趣小组的习题,每一期内容会包括三个部分:题目、小伙伴答案和全球开发者答案。话不多说,Show you the code ~
工具/原料
题目来源:Codewars
Python 2.7
Round 8# Give me Diamond
1、目前为止,最难一题。题引:Th坡纠课柩is kata is to practice simple string output. Jamie is a programmer, and girlfriend of James. She likes diamonds, and this time she expects String of diamond from James. As James doesn't know how to do it, he needs your help.
2、简单几个测试用例
3、注意,结果是以字符串返回的,不是直接打印
Local answers
1、看谁能写出,优美如钻的代码
2、这里初学的同学要注意的是,有些代码光读是不能完全理解的,这时候需要把代码实际运行起来
3、所以说,尤其是类似的代码,就需要有注释作为补充
Global answers
1、解这个问题可能会花一些时间,但是这个对于学习和攻克问题的信心,是非常重要的体验。加油。