Tuesday, December 8, 2020

python day7 for loops

 '''

#day 7 for loops


syntax:while condition:

    statements

    


syntax: for variable in range(start,stop,step):


 for i in range(5):

     print(i)

     

for i in range(5):

     print("*")

     

for i in range(5):

     print("praveen")

     

     

k=0

for i in range(5):

     for j in range(5):

         print("j=",j,end="-")

         k=k+1

         print("k:",k)



for i in range(5):

    for j in range(5):

        print("*")


for i in range(5):

    for j in range(5):

        if i==j:

            print(i,j)

'''

for i in range(5):

    for j in range(5):

        #if i==j:

        print("*",end=' ')

    print()






python class topic video