''' while-as long as condition is true 1. starting value 2. condition or terminating value or ending value 3. update (increment/decrement) Or infinite loop 1. starting value 2. condition or terminating value or ending value when it will reach to the ending position #1 method d=1 while(d==1): # print("1.area of rectangle") print("2.area of circle") print("3.exit") n=int(input("enter ur choice")) if(n==2): r=int(input("enter radius")) print("area of circle",3.14*r*r) elif(n==1): l=int(input("enter length")) b=int(input("enter breadth")) print("area of rectangle",l*b) elif(n==3): print("end of the program") d=0 print("hello ur program is over") #2 method while True: # print("1.area of rectangle") print("2.area of circle") print("3.exit") n=int(input("enter ur choice")) if(n==2): r=int(input("enter radius")) print("area of circle",3.14*r*r) elif(n==1): l=int(input("enter length")) b=int(input("enter breadth")) print("area of rectangle",l*b) break elif(n==3): print("end of the program") break #statement -is used to terminate or end the loop . it is always used in loop but in condition print("hello ur program is over") #-------------------------------------------------------------------------------- ''' """ while True: print("1.area of rectangle") print("2.area of circle") print("3.exit") n=int(input("enter ur choice")) if(n==2): r=int(input("enter radius")) print("area of circle",3.14*r*r) elif(n==1): l=int(input("enter length")) b=int(input("enter breadth")) print("area of rectangle",l*b) elif(n==3): print("end of the program") break """ #------------------------------------------------------------------- for i in range(10): #print(i) if(i==5): print(i) break