Python入门实战:Round 1

2024-11-11 03:19:27

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

Python入门实战:Round 1

工具/原料

题目来源:Codewars

Python 2.7

Round 1# Double Char

1、Given a string, you have to return a string in which each character(case-sensitive) is repeated once.

Python入门实战:Round 1

2、Start from here

Python入门实战:Round 1

Local answers

1、来看几个小伙伴的答案。

Python入门实战:Round 1

2、大家看到了,因为有的小伙伴原来是写JAVA的,所以代码看起来就不太Pythonic,这是初学Python比较容易出现的问题。

Python入门实战:Round 1

3、篇幅所限,就没有show全部了,大家应该能看出来对一些基础知识掌握的是否扎实

Python入门实战:Round 1

Global answers

1、这里把全球开发者的答案放出来,完整的文档也放在文末供下载。

Python入门实战:Round 1

2、因为这题比较简单,就不作点评了~

Python入门实战:Round 1
猜你喜欢