在for迴圈中使用字串進行迭代,如下。
str1 = "hello" for i in str1: print(i) # 結果如下 h e l l o
Copyright © All rights reserved | This template is made with by Colorlib