본문 바로가기

Python_Matter/Solve

Python Learn the basics Quiz 15

반응형

Q>

*****

****

***

**

*

을 출력 하는 프로그램을 작성하시오.


A1>

for i in range(0, 5):
star = ""

for j in range(5, i, -1):
star += "*"

print(star)


A2>

for i in range(0, 5):
for j in range(5, i, -1):
if j > i:
print('*', end = '')
print()


O1>

*****

****

***

**

*


Process finished with exit code 0


O2>

*****

****

***

**

*


Process finished with exit code 0



반응형

'Python_Matter > Solve' 카테고리의 다른 글

Python Learn the basics Quiz 17  (0) 2019.03.27
Python Learn the basics Quiz 16  (0) 2019.03.27
Python Learn the basics Quiz 14  (0) 2019.03.27
Python Learn the basics Quiz 13  (0) 2019.03.18
Python Learn the basics Quiz 12  (0) 2019.03.18