Question: PYTHON 3 PROGRAM Hey everyone, I need to make a program where the user can select the number of stars to be printed in a

PYTHON 3 PROGRAM

Hey everyone, I need to make a program where the user can select the number of stars to be printed in a triangular pattern. Here is my code below; it works so far, I just need helping making it possible so the user can select how many stars there are supposed to be in triangles. For instance "How large would you like the triangle?: 6" the program would then print a triangle with a base of 6 and a height of 6.

n = 0

print ("Pattern A") for x in range (0,11): n = n + 1 for a in range (0, n-1): print ('*', end = '') print() print ('') print ("Pattern B") for b in range (0,11): n = n - 1 for d in range (0, n+1): print ('*', end = '') print() print ('')

print ("Pattern C") for e in range (11,0,-1): print((11-e) * ' ' + e * '*')

print ('') print ("Pattern D") for g in range (11,0,-1): print(g * ' ' + (11-g) * '*')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!