Skip to content

KOBIC 차세대 생명정보 교육 파이썬기초편 6강 #
Find similar titles

연습문제 답 #

1 #

n=5;
for i in range(n):
    for j in range(i):
        print ('* ', end="")
    print('')

for i in range(n,0,-1):
    for j in range(i):
        print('* ', end="")
    print('')

2 #

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
count_odd = 0
count_even = 0
for x in numbers:
        if not x % 2:
             count_even+=1
        else:
             count_odd+=1
print("Number of even numbers :",count_even)
print("Number of odd numbers :",count_odd)
0.0.1_20140628_0