pythonExample100/JCP010.py

18 lines
357 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'''
【程序10】
题目:打印楼梯,同时在楼梯上方打印两个笑脸。
1.程序分析用i控制行j来控制列j根据i的变化来控制输出黑方格的个数。
2.程序源代码:
'''
import sys
sys.stdout.write(chr(1))
sys.stdout.write(chr(1))
print ''
for i in range(1,11):
for j in range(1,i):
sys.stdout.write(chr(219))
sys.stdout.write(chr(219))
print ''