Skip to content

Instantly share code, notes, and snippets.

@sshehrozali
Created May 13, 2022 16:07
Show Gist options
  • Save sshehrozali/90a0c109b3ee3717c321be984c98a139 to your computer and use it in GitHub Desktop.
Save sshehrozali/90a0c109b3ee3717c321be984c98a139 to your computer and use it in GitHub Desktop.
uncompleted-while-loop
i = 0 # for Parent While Loop
j = 0 # for Child Loop
counter = 10 # DON'T TOUCH IT (constant)
# What's the Output?
# Hello Cat!
# Hello Cat!
# Hello Cat!
# Hello Cat!
# Hello Cat!
# ============
# Hello Cat!
# Hello Cat!
# Hello Cat!
# Hello Cat!
# Hello Cat!
# ============
while i < counter:
# Every time we are going to print 5 times
while 0 < 5:
print("Hello Cat!")
j = j + 1
j = 0 # Reset the value of j after nested loop is ended
print("================")
i = i + 1 # increasing i by 1 step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment