ASCII ARTS Exercises: Draw a left-aligned upside-down triangle: **** *** ** * Draw a right-aligned upside-down triangle: **** *** ** * Draw a centered triangle: * ** *** ****
Added by Alicia R.
Close
Step 1
Here's an example code: ``` rows = 5 for i in range(rows, 0, -1): for j in range(i): print("*", end="") print() ``` This code will print the following output: ``` ***** **** *** ** * ``` To draw a centered triangle, we can modify the code Show more…
Show all steps
Your feedback will help us improve your experience
John Bell and 101 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Python to print Downward Triangle Pattern
Chandra J.
Print Downward Triangle Pattern Using Python
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD