'python I tried to change 'while-loop' to 'for-loop' but it didn't get same result

This is 'while' code

 ##전역변수 선언 부분##
i,k=0,0

##메인코드 부분##

i=0
while i<9:
    if i<5:
        k=0
        while k<4-i:
            print('  ', end='')
            k+=1
        k=0
        while k<i*2+1:
            print('\u2665', end='')

and I changed this 'while' to 'for' but isnt same result :(

 ##전역변수 선언 부분##
i,k=0,0

##메인코드 부분##

for i in range(0,9):
    if i<5:
        for k in range(0,4-i):
            print('  ',end='')
            k+=1
        for k in range(0,i*2+1):
            print('\u2665',end='')

        


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source