Back to Browse

Python Pattern Programs - Printing Stars '*' and "A" in Right Angle Triangle Shape | Star Pattern

15.4K views
Oct 3, 2019
16:01

In this Python Pattern Printing Programs video tutorial you will learn to print star '*' in right angle triangle shape. To print star pyramid patterns in python you have to use two for loops. This program contains two for loops: the first loop is responsible for rows and the second for loop is responsible for columns. For python 2: import operator n = input("enter the number of rows:") for i in range(n): count=0 for j in range(n-i-1): print " ", for j in range(i+1): print "*", if operator.lt(count,i): #or write the condition as in above program print "A", count=count+1 print lt(a, b) is equivalent to a less than b condition. For more free tutorials on computer programming http://www.facebook.com/AmulsAcademy twitter.com/AmulsAcademy

Download

1 formats

Video Formats

360pmp419.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Python Pattern Programs - Printing Stars '*' and "A" in Right Angle Triangle Shape | Star Pattern | NatokHD