Write a GUI-based program that implements the bouncy program discussed in programming project 4 of Chapter 3.
I keep getting this indentation error and I can't figure out why. Can someone please help me?
```python
from breezypythongui import EasyFrame
class Bouncy(EasyFrame):
def __init__(self):
EasyFrame.__init__(self, title="Bouncing Ball")
self.height = self.addIntegerField(value=0, row=1, column=1, columnspan=2)
self.addLabel(text="Enter the height up to which ball bounced back first", row=1, column=0)
self.firstBounce = self.addIntegerField(value=0, row=1, column=1, columnspan=2)
self.addLabel(text="Number of times the ball bounced back", row=2, column=0)
self.numberofTimes = self.addIntegerField(value=0, row=2, column=1, columnspan=2)
self.addButton("Calculate Total Distance", row=4, column=0)
self.totalDistance = self.addLabel(text="", row=4, column=0)
def calculate(self):
try:
height = self.height.getNumber()
bounceDist = self.firstBounce.getNumber()
numOfTimes = self.numberofTimes.getNumber()
BouncingIndex = float(bounceDist) / float(height)
except (ValueError, ZeroDivisionError):
self.messageBox(title="Error Message", message="Invalid Input !!")
return
distance = height + bounceDist
for i in range(0, numOfTimes - 1):
bounceBackDist = bounceDist * BouncingIndex
distance += bounceDist + bounceBackDist
bounceDist = bounceBackDist
text = "The total distance travelled by the ball is: %.lf ft." % distance
self.totalDistance["text"] = text
def main():
Bouncy().mainloop()
if __name__ == "__main__":
main()
```