cla14

py

School

University of the Cumberlands *

*We aren’t endorsed by this school

Course

131

Subject

Computer Science

Date

Oct 30, 2023

Type

py

Pages

1

Uploaded by ColonelClover4830

Report
#cla14.py #Ke'Shawn Stafford #10/23/2023 #a program should have a main function that reads three inputs - a symbol and 2 integer values (width and height), and draws the figures similar to the sample run def drawBar(symbol,length): print(symbol*length) def drawRectangle(symbol,width,height): for i in range(height): for j in range(width): print (symbol,end="") print() def drawTriangle(symbol,height): for i in range (1,height+1): print(symbol*i) for j in range (height-1,0,-1): print(symbol*j) def main(): symbol=input("enter the symbol to draw the shape: ") width=int(input("enter the width of the shape: ")) height=int(input("enter the height of the shape: ")) drawRectangle(symbol,width,height) print("\n") drawTriangle(symbol,height) main()
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help

Browse Popular Homework Q&A