In python 3, I asked for help earlier and was giving an answer that had indentat
ID: 3778913 • Letter: I
Question
In python 3, I asked for help earlier and was giving an answer that had indentation errors and syntax errors in it and still wouldn't work after. But anyways looking for a solution to this problem again.
5.14 Warm up: Drawing a right triangle (Python 3) This zyLab activity is intended for students to prepare for a larger programming assignment. Warm up exercises are typically simpler and worth fewer points than a full programming assignment Warm up exercises are ideally suited for an in-person scheduled lab meeting or as selfpractice. The next section provides a full programming assignment This program will output a right triangle based on user specified height triangle height and symbol triangle char. (1) The given program outputs a fixed-height triangle using a character. Modify the given program to output a right triangle that instead uses the user specified triangle char character. (1 pt) (2) Modify the program to use a loop to output a right triangle of height triangle height. The first line will have one user-specified character, such as or Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches triangle height. Output a space after each user-specified character, including a line's last user-specified character. (2 pts) Example output for triangle char 3% and triangle height 5 Enter a character: Enter triangle height: 5 Submission 5.14.1: Warm up: Drawing a right triangle (Python 3) Lab Load default template... File: main.py 1 print Enter a character 2 triangle char input 4 print Enter triangle height 5 triangle eight int (input 7 print 8 print 9 print 10Explanation / Answer
ch = input("Enter a character:")
n = int(input("Enter triangle height:"))
for i in range(1,n+1):
for j in range(0,i):
print(ch,end="")
print("")
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.