python - pig latin问题 总是出现list/string index out of range
PHP中文网
PHP中文网 2017-04-18 10:27:53
0
1
648

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
大家讲道理
  1. x 的初始值要設為 0 不是 1, 否則最後一圈的時候 x 值會是 n, this index is out of range

  2. Use for i in range(n) 時, 我們直接使用 i 做為 loop variable 即可, 不必另外使用一個變數 x


Questions I answered: Python-QA

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!