r/pythonhomeworkhelp • u/momochan1031 • Feb 20 '23
python help! Pretty simple I believe I am just stupid
Given the following code, what is printed?
def mod_test(value, mod):
return value % mod
print(mod_test(26, 4))
r/pythonhomeworkhelp • u/momochan1031 • Feb 20 '23
Given the following code, what is printed?
def mod_test(value, mod):
return value % mod
print(mod_test(26, 4))
r/pythonhomeworkhelp • u/burningice07 • Jan 08 '23
Hi,
please check the attached PDF,
I want to extract tabular data "Composition","Top 10 Holdings","Morningstar Equity Sectors" and also Market cap which has no header.
it it possible to extract the data in excel file and repeat this process for multiple similar files?
Thank you for your valuable time and help in advance.
r/pythonhomeworkhelp • u/AdOk3651 • Oct 19 '22
This is the output I need

I keep getting assertion errors with this code:
from breezypythongui import EasyFrame
class TidbitGUI(EasyFrame):
def __init__(self):
EasyFrame.__init__(self, title = "Tidbit Loan Scheduler")
self.addLabel(text="Purchase Price",row=0,column=0)
self.priceField = self.addFloatField(value=0.0,row=0, column=1)
self.addLabel(text="Annual Interest Rate",row=1,column=1)
self.rateField = self.addIntegerField(value=0,row=1,column=1)
self.button = self.addButton(text="Compute", row=2, column=0,columnspan=2,command=self.computeSchedule)
self.button.bind("<Return>", lambda event: self.computeSchedule())
self.outputArea = self.addTextArea("",row=3,column=0, columnspan=3,width=84,height=15)
def computeSchedule(self):
annual_rate = self.rateField.getNumber() / 100
monthly_rate = annual_rate / 12
purchase_price = self.priceField.getNumber()
mounthly_payment = 0.05 * (purchase_price - (0.10 * purchase_price))
month = 1
balence = purchase_price
self.outputArea.setText("Month Starting Balance Interest to Pay Principal to Pay Payment Ending Balance\n")
while balence > 0:
if mounthly_payment == balence:
mounthly_payment = balence
interest = 0
else:
interest = balence * monthly_rate
principle = mounthly_payment - interest
remaining_balence = balence - mounthly_payment
monthly_numbers = str("%2d%15.2f%15.2f%17.2f%17.2f%17.2f\n" % \
(month, balence, interest, principle, mounthly_payment, remaining_balence))
self.outputArea.appendText(monthly_numbers)
balence = remaining_balence
month += 1
def main():
TidbitGUI().mainloop()
if __name__ == "__main__":
try:
while True:
main()
except KeyboardInterrupt:
print("\nProgram closed.")