'Print two lines of stars with WConio.gotoxy() at different locations in console

import WConio

i=0
WConio.gotoxy(0,0)
while i<80:
    print("*",end="")
    i+=1
i=0
WConio.gotoxy(0,20)
while i<80:
    print("*",end="")
    i+=1
print("")
input()

It prints only one line at x == 20 and exits.



Solution 1:[1]

You never set i back down to zero. This causes the second loop's condition to be false immediately, so the loop is never executed. Add i = 0 before the second while loop.

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 Arya McCarthy