Discuss / Python / 习作

习作

Topic source

與生懼來

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

# -*- encoding: utf-8 -*-

#For循环

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

for name in L:

  print('Hello, %s!'% name)

#While循环

maxNum = len(L)

i = 0

while i < maxNum:

  print('Hello, %s!' % L[i])

  i = i + 1


  • 1

Reply