Python入门实战:Round 8

2025-11-19 11:32:17

哈,这个系列是跟小伙伴一起组织的Python兴趣小组的习题,每一期内容会包括三个部分:题目、小伙伴答案和全球开发者答案。话不多说,Show you the code ~

Python 2.7

Round 8# Give me Diamond

目前为止净彩,最难一题。题引:

This 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.

Python入门实战:Round 8

简单几个测试用例

Python入门实战:Round 8

注意,结果是以字符串返回的返总爬,不是直接打茄驼印

Python入门实战:Round 8

Local answers

看谁能写出,优美如钻的代码

Python入门实战:Round 8

这里初学的同学要注意的是,有些代码光读是不能完全理解的,这时候需要把代码实际运行起来

Python入门实战:Round 8

所以说,尤其是类似的代码,就需要有注释作为补充

Python入门实战:Round 8

Python入门实战:Round 8

Global answers

解这个问题可能会花一些时间,但是这个对于学习和攻克问题的信心,是非常重要的体验。加油。

Python入门实战:Round 8

注意事项

代码下载:https://pan.baidu.com/s/1qZOzLNm

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢