String length without len function

前端 未结 17 1316
逝去的感伤
逝去的感伤 2020-12-10 21:29

Can anyone tell me how can I get the length of a string without using the len() function or any string methods. Please anyone tell me as I\'m tapping my head ma

17条回答
  •  甜味超标
    2020-12-10 22:06

    Create a for loop

    styx = "How do I count this without using Lens function" number = 0 for c in styx: number = 0 + 1 print(number)

提交回复
热议问题