Posts

Showing posts with the label matrix patterns in python latest version

star patterns in python

As we all know,python is an easy  to start programming language. Patterns are the most problems given in hiring interviews. So,lets get started fully on patterns. problem 1: For an input number 'n',print right angle triangle of n columns in '*'. sample input:5 sample output: * * * * * * * * * * * * * * * python code: n=int(input()) for i in range(n):     for j in range(0,i+1):         print('* ',end='')     print('\n') problem 2: sample input:5 sample output: * * * * * * * * * * * * * * * * * * * * * * * * * python code: n=int(input('enter integer input\n')) for i in range(1,n+1):     print('* '*(2*i-1)) problem 3: sample input:5 sample output: *       *   *   *      *      *   *  *       * python code: n=int(input()) for i in range(0,n):     for j in range(n):     ...