Discuss / Python / homework

homework

Topic source
L = []
n = 1
while n <= 99 :
    L.append(n)
    n = n + 2
    
print('列表数量的一半:',int(len(L)/2),'个')
print("L列表前一半元素为:")

i = 0
while i <= len(L)/2-1:
    print(L[i])
    i = i+1

  • 1

Reply