Question: Create a Python function called print Triangle that expects one argument, a non- negative integer, and prints a right triangle, where both the height
Create a Python function called print Triangle that expects one argument, a non- negative integer, and prints a right triangle, where both the height of the triangle and the width of the base of the triangle are given by the value passed as the argument. This function does not return any value. Your function should use your solution to Problem 3 in printing the triangle. Here are some examples of how your function should behave: >>> print Triangle(4) A *** **** >>> print Triangle(3) A *** >>> print Triangle(2) >>> print Triangle(1) A >>> print Triangle(0) >>>
Step by Step Solution
3.33 Rating (153 Votes )
There are 3 Steps involved in it
You can create the printTriangle function in Python as follows def printTriangleheight for i in ... View full answer
Get step-by-step solutions from verified subject matter experts
