2018年6月26日

摘要: 函数的定义及调用 使用函数能够减少代码的冗余,并可以多次重复使用。下面以求字符串的长度为例,来说明一下函数的定义与调用。 def mylen(): s1 = 'hello word' length = 0 for i in s1: length = length + 1 print(length) 阅读全文

posted @ 2018-06-26 20:19 时光top 阅读(245) 评论(0) 推荐(0) 编辑


Copyright © 2024 时光top
Powered by .NET 8.0 on Kubernetes