Discuss / Python / for循环

for循环

Topic source

燕喜泥润

#1 Created at ... [Delete] [Delete and Lock User]

L = ['Bart', 'Lisa', 'Adam']

for i in L:

    print('hello,%s'%i)

SHERYOOD

#2 Created at ... [Delete] [Delete and Lock User]

您好 请问一下 为什么下面这段代码打到python交互式环境会报错 但是打到pycharm却没事?

sum = 0

n = 99

while n > 0:

    sum = sum + n

    n = n - 2

print(sum)

QiaOPOP

#3 Created at ... [Delete] [Delete and Lock User]

缩进调一下


  • 1

Reply