Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions loops_nested_loop.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@




#main function starts
def main():
i=0
while(i<5):
while(i<5): #outer while loop
print("i={}".format(i))
i+=1
i+=1 #increment value of i by 1 i.e i = i+1
j=5
while(j>i):
print("j={}".format(j))
j-=1
while(j>i): #inner while loop
print("j={}".format(j)) #format() funtion used for format the string in python
j-=1 #decrementing value of j by 1 i.e j=j-1



Expand Down