Posts

Showing posts from August, 2019

Pattern #2 on Python

Pattern #2 (Like Right angle Triangle) Hi Friends Welcome Yesterday we seen how to make left angle triangle pattern with star and given string. Here similarly we code for right angle triangle pattern   Output: (Input is 3 rows)   *  ** ***  ---- CODE: a = int(input('Enter number of rows: ')) for i in range(a):     n = a - i - 1     for j in range(a):         if n > j:             print(' ',end='')         else:             print('*',end='')     print() ------ By  PyKAR

Pattern #1 with input string on Python

Pattern #1 with input string Hi friends Welcome already we seen pattern #1 (Only star print) Today, similar pattern type,but there pattern format is given input Like if you give input is PyKAR, pattern is: ------- P Py PyK PyKA PyKAR ------ Similarly, you can give any input... CODE: b = input('Enter name: ') a = len(b) d = list(b) for  i in range(a):     for j in range(i+1):         print(d[j],end='')     print() ---- # This code for Reverse input pattern b = input('Enter name: ') a = len(b) c = '' for i in b:     c = i + c d = list(c) for  i in range(a):     for j in range(i+1):         print(d[j],end='')     print() ----- By PyKAR

Pattern # 1 On Python

Pattern # 1 Hi Friends Welcome back again Today we code for pattern  like (number of rows: 3) * ** *** above method pattern print by the getting input from user CODE: a = input("Enter number of rows: ") for i in range(int(a)):   for j in range(0,i+1):     print('*',end='')   print() ---- By PyKAR