HOME/Articles/

simple python-example-23 (snippet)

Article Outline

Python example 'python-example-23'

python-example-23

Python example: python-example-23

#!/usr/bin/python
# -*- coding: UTF-8 -*-

from sys import stdout
for i in range(4):
    for j in range(2 - i + 1):
        stdout.write(' ')
    for k in range(2 * i + 1):
        stdout.write('*')
    print

for i in range(3):
    for j in range(i + 1):
        stdout.write(' ')
    for k in range(4 - 2 * i + 1):
        stdout.write('*')
    print