Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For PYTHON: I have an infinte loop within my program and I need help modifying the code to make a simple half arrow. Nothing fancy,

For PYTHON: I have an infinte loop within my program and I need help modifying the code to make a simple half arrow. Nothing fancy, just simple clean code. Please help. Thank you :)

Here is my code

arrow_head_width = 0 print('Enter arrow base height: ') arrow_base_height = int(input()) print('Enter arrow base width: ') arrow_base_width = int(input()) while arrow_head_width <= arrow_base_width: print('Enter arrow head widht: ') arrow_head_width = int(input()) for i in range(0,arrow_base_height): for j in range(0, arrow_base_width): print ("*"), print ("") for i in range(0, arrow_head_width): for j in range(i, arrow_head_width): print ("*"), print ("")

Here is the code from the original program

print ('Enter arrow base height: ') arrow_base_height = int(input()) print ('Enter arrow base width: ') arrow_base_width = int(input()) print ('Enter arrow head width: ') arrow_head_width = int(input())

# Draw arrow base (height = 3, width = 2) print ('**') print ('**') print ('**')

# Draw arrow head (width = 4) print ('****') print ('***') print ('**') print ('*')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Connect with business communities

Answered: 1 week ago