现象:遍历字符串输出了8次
代码:
a="tomorrow"
for x in a:
print(a)
结果:
PS C:\Users\Desktop\learn\python> & 'D:\Python&Pycharm\Python-3.9.0\python.exe' 'c:\Users.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy\launcher' '6853' '--' 'c:\Users\Desktop\learn\python\lesson1.py'
tomorrow
tomorrow
tomorrow
tomorrow
tomorrow
tomorrow
tomorrow
tomorrow