Question: Write a python program for the following Write a graphics method: make stripe (n, ch) that returns n consecutive ch characters. (e.g., makeStripe (5, 'X')

Write a python program for the followingWrite a python program for the following Write a "graphics" method: make

Write a "graphics" method: make stripe (n, ch) that returns n consecutive ch characters. (e.g., makeStripe (5, 'X') should return XXXXX) Use this method to write a program that draws triangles. For example, can use these methods to draw one of these patterns: Try and draw your triangles efficiently (i.e., using loops to minimize the number of statements). Handle choices outside 1 to 5; after printing for the size of out the result string. If the number entered for the size of base is even, use the next higher odd number. Here is the precise dialog required: Program to draw triangles. Written by John Koch. Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw: * Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw:* Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 3 Enter character used to draw: * Enter number of blanks preceding each line: 3 The program should be stored in triangles.py. You may run turning for triangles as many times as you want. This program is due at noon on Tuesday, April 18, 2017. This program is worth 90 points Write a "graphics" method: make stripe (n, ch) that returns n consecutive ch characters. (e.g., makeStripe (5, 'X') should return XXXXX) Use this method to write a program that draws triangles. For example, can use these methods to draw one of these patterns: Try and draw your triangles efficiently (i.e., using loops to minimize the number of statements). Handle choices outside 1 to 5; after printing for the size of out the result string. If the number entered for the size of base is even, use the next higher odd number. Here is the precise dialog required: Program to draw triangles. Written by John Koch. Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw: * Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw:* Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 3 Enter character used to draw: * Enter number of blanks preceding each line: 3 The program should be stored in triangles.py. You may run turning for triangles as many times as you want. This program is due at noon on Tuesday, April 18, 2017. This program is worth 90 points

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!