#作业2017.6.10实践作业走起2-3

作业triangle,循环走起

#!/usr/bin/env python
#congding:utf-8

i = 0
for i in range(0,10):
    i += 1
    for k in range(0,i):
        print '*',
    print '\n'

print '--------------'

for i in range(0,10):
    for k in range(0,10-i):
        print '*',
    print '\n'

print '--------------'

for i in range(0,10):
    for l in range(0,10-i):
        print ' ',
    for k in range(10-i,10):
        print '*',
    for m in range(10,10+i-1):
        print '*',
    print '\n'

你可能感兴趣的:(#作业2017.6.10实践作业走起2-3)