Python Forum
Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HOMEWORK HELP
#1
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
Reply
#2
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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020