一、简单图形打印
'''
打印一下图形在输入上面
* * * * *
* * * * *
* * * * *
'''
print("hello world")
二、
"""
打印一下图形在输入上面
* * * * *
* * * * *
* * * * *
"""
"""
print("* * * * *")
print("* * * * *")
print("* * * * *")
print("* * * * *")
"""
"""
# 更改上面代码
print("* " * 5)
print("* " * 5)
print("* " * 5)
print("* " * 5)
"""
'''
for i in range(0, 4):
print("* " * 5)
'''
'''
for i in range(0, 4):
for j in range(5):
print("* ", end= "")
print()
'''
'''for i in range(0, 4):
print("* " * 5)
----------------------------------
'''
# 简单图形打印
"""
打印一下图形在输出上面
* * * * *
* *
* *
* *
* * * * *
"""
'''
for i in range(4):
if i == 0 or i == 3:
print("* " * 5)
if i == 1 or i == 2:
print("* *")
------------------------------
'''
# 更改上面写法
# 外层循环控制行
for i in range(4):
if i == 0 or i == 3:
print("* " * 5)
if i == 1 or i == 2:
for j in range(5):
if j == 0 or j == 4:
print("* ", end="")
else:
print(" ", end="")
print()