34 Program to demonstrate While-Else Loop in Python

Program:

#program for while-else

x=1

while(x<=5):

    print("hello")

    x=x+1

else:

    print("world")

print("end")


Output:

Program to demonstrate While-Else in Python

Previous
Next Post »