+ 1

Can any one explain this program step by step plz

for i in range(1,6): for j in range (1,i+1): print i print output 1 22 333 4444 55555

31st Aug 2017, 12:35 PM
corejava
3 Answers
+ 5
for i in range(1,6)#i=1,2,3,4,5 for j in range(1,i+1)#(1),(1,2),(1,2,3),(1,2,3,4),(1,2,3,4,5) print(i)#(1),(2,2),(3,3,3),(4,4,4,4),(5,5,5,5,5)BTW Python 3+ uses print() not simply print print#this is still very python 2.7 the print statements should be : print(i,end='\n') print("")
31st Aug 2017, 1:03 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
sorry I didn't get ur answer
31st Aug 2017, 1:19 PM
corejava
0
For step by step answers on Python, this may help. http://www.pythontutor.com/
31st Aug 2017, 1:42 PM
Samantha Jordan
Samantha Jordan - avatar