python pattern programming
PYTHON PATTERN PROGRAMMING Python nested loop: Python allow programmer to use nested loops.Nested loop means when one loop is define into another loop is known as nested loop,in which one is called inner loop and another is called outer loop.In which when outer loop's condition is true than inner loop will be execute. we use the concept of nested loop in pattern programming etc. syntax: while (condition): while (condition): statement x statement y Some examples of nested loop. Nested loop program. Q. write a program to print following pattern. P P Y P Y T P Y T H P Y T H O P Y T H O N str = "PYTHON" for i in range ( 0 , 6 ): print () for j in range ( 0 ,i+ 1 ): print (str[j], end = ' ' ) Q. write a program to print following pattern. * * * * * * * * * * * * * * * for i in range ( 1 , 6 ): print () for
👌👌👌
ReplyDelete