WHILE LOOPS

PHOTO EMBED

Wed Oct 26 2022 15:13:50 GMT+0000 (Coordinated Universal Time)

Saved by @diogoteixeirakv #python

#WHILE LOOPS
x=0
while x<5:
    print("Not there yet, x=" + str(x))
    x=x+1
print("x="+str(x))    

print("\n")

x=0
while x<8:
    print("Not there yet, x=" + str(x))
    x=x+1
print("x="+str(x))    

print("\n")
#MORE WHILE LOOPS
def attempts(n):
    x=1
    while x<=n:
        print("Attempt" + str(x))
        x+=1
    print("Done")    
attempts(3)
    
    
print("\n")
#INITIALIZING VARIABLES
def count_down(start_number):
    current=3
    while current>0:
        print(current)
        current-=1
    print("zero")
count_down(434) #é indiferente o número daqui   

print("\n")
def count_down(start_number):
    current=6
    while current>0:
        print(current)
        current-=1
    print("zero")
count_down(434) 
content_copyCOPY