Discuss / Python / 作业

作业

Topic source

LingByron

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

NO.1

#!/usr/bin/env python3
#-*- coding:utf-8 -*-
L = ['Bart','Lisa','Adam']
for name in L:
    print(name)

NO.2

#!/usr/bin/env python3
#-*- coding:utf-8 -*-
L = ['Bart','Lisa','Adam']
i = len(L) - 1
while i >= 0:
    print(L[2 - i])
    i -= 1

python3 /home/linuxmint/文档/python_stu/homework.py

Bart
Lisa
Adam

  • 1

Reply