Answers for "Write a program in Python to 4. Python program for the upside-down triangle of x. The program should get an even integer n as input and draw the triangle as follows."

0

Write a program in Python to 4. Python program for the upside-down triangle of x. The program should get an even integer n as input and draw the triangle as follows.

rows= int(input("Enter an even number of rows: "))

if rows%2==0:
  for i in range(rows + 1, 0, -1):
    for j in range(0, i - 1):
        print("*", end=' ')
    print(" ")
else:
  print("Input Error!")
Posted by: Guest on July-27-2021

Code answers related to "Write a program in Python to 4. Python program for the upside-down triangle of x. The program should get an even integer n as input and draw the triangle as follows."

Python Answers by Framework

Browse Popular Code Answers by Language