#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)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter