Python Forum
HOMEWORK HELP - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: HOMEWORK HELP (/thread-12870.html)



HOMEWORK HELP - abdullahali - Sep-17-2018

Hey,

i am new to python, and trying to do this assignment

Write a program for Tractor Jack that will ask the user to input the total value of booty plundered (in dollars),
and the number of crew (not including Tractor Jack himself). Then the program should display the value
of Tractor Jack’s share of the booty (before his charitable donation), the value of the remaining share to be
divided amongst the crew, the value of booty that each crew member receives, and the amount of money
Jack donates to the food bank.

that is my assignment ^ and this is my code, but it is not working for some reason.
a = int ( Input (“total value of booty in dollars: ”))
b =Input (“the amount of members in the crew, discluding jack”)
c = Print (“Tractor Jack’s 30% share of the booty is worth”), a*.3
print(“Crew’s 70% share of the booty is worth”, a - c)
Print(“each crew member takes home”, d/b”)
Print(“Jack donates”, c*15/100, “to the saskatoon food bank”)
everything works until the a - c part.

thanks in advance


RE: HOMEWORK HELP - Mekire - Sep-17-2018

You can't assign the result of a print function (well, you can but you don't want to).
Also you need to make sure you are always doing math with numbers, not strings.
a = int(input("total value of booty in dollars: "))
b = int(input("the amount of members in the crew, discluding jack: "))
c = a * 0.3
d = a - c