Question: Python Pls! Write a program that outputs the below triangle. The user must input two values. The first input is the character to print for

Python Pls!

Python Pls! Write a program that outputs the below triangle. The usermust input two values. The first input is the character to print

Write a program that outputs the below triangle. The user must input two values. The first input is the character to print for the triangle and the second input is the maximum width of the triangle. Implement the draw() function that takes these two values as parameters. Then, inside this function, you need to use nested loops to print the triangle. The function returns the word 'Done' after outputting the triangle. Hint: First draw the top half, then write a program to draw the bottom half Example 1: if the input Enter Character: % Enter Height: 7 then your program should print: q $$$$$$$ $$ Done Example 2: if the input is Enter Character: + Enter Height: 4 then your program should print: + ++ +++ ++++ +++ ++ + Done If the height given is 1, then you should just print a single character: Enter Character: + Enter Height: 1 then your program should print: + Done main.py Load default template... 1 # Define a function that takes these two values as parameters. 2 def draw character, height): 3 # nested loops and proper return value 4 return 5 6 if __name__=='__main__': 7 # Ask the user to input two values. 8 # Valuel: the first character. 9 # Value2: Traingle height. 10 character=input("Enter Character: ") 11 height=int(input("Enter Height: ') 12 print(draw character, height)

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!