This topic created in 4021 days ago, the information mentioned may be changed or developed.
最近Introduction to Computation and Programming Using Python的中文译版上市了,叫《编程导论》其中中文版p76有一个动手练习是要求用到try-except块实现如下函数:
def sumDigits(s):
'''假设s是一个字符串
返回S中十进制数的和
例如,如果s是'a2b3c',函数返回5'''
请问该如何实现?谢谢!
1 replies • 2015-04-29 10:41:10 +08:00
 |
|
1
hazard Apr 29, 2015
呃。。。搞定了。。。刚才出了点小问题。。。不好意思。。。
|