name="zhangsan"
#print(name)
#函数输出长度
#print(len(name))
#for循环输出长度
'''length=0
for i in name:
length+=1
print(length)
'''
#定义函数输出长度 def mylen后的()代表函数参数存放的地方
'''def mylen():
# 函数体 缩进代表包含意思
a='hello'
length=0
for i in a :
length+=1
print(length)

mylen() # 此()代表执行函数中的内容
'''

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-10-12
  • 2022-02-06
  • 2022-12-23
相关资源
相似解决方案