Print Downward Triangle Pattern Using Python
Added by Scott S.
Step 1
** Show more…
Show all steps
Your feedback will help us improve your experience
Chandra Jain and 63 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.
Exercise 11: Decreasing Numbers Create a nested loop that produces the output below. For this problem, you need to use nested for loops. ....1 ...2 ..3 .4 5 Notice that as you move down the output, the numerical value increases, but the number of periods decreases. The inner loop will print the periods, while the outer loop will print the numbers. You can use "end=" with your print statements in the inner loop so you don't automatically add a newline character. This will allow you to print them all on one line. Also, don't forget that the range() function allows us to count upwards and downwards.
Akash M.
Write and test a Python script that reads in two floating-point side lengths of a right triangle and outputs the hypotenuse length, perimeter, and area.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD