Python 3.4.1 Help Please: I will post my code that i have gotten so far below, What i need to do is if given x amount of inches, and a cost (per yard), how do i find the total cost? I know i have to convert it to yards but just having a brain fart. Please help me out here
``` total = eval(input('How many inches of material? ')) cost = eval(input('What is the cost (per yard)? ')) age = eval(input('What is your age? ')) #Start Math yards = total // 36 total = total % 36 feet = total // 12 total = total % 12 inches = total #End Math print('You bought ' + str(yards) + ' yards, ' + str(feet) + ' feet ' + str(inches) + ' inches of material') #Start Math Part II #End Math Part II print('Material Cost: ') ```
im going into my next class now, even if im not online please just post what your willing to to help me, ill be back soon.
Take your inches, we are assuming linear, and divide it by 36 to get the inches to yard conversion. \[\frac{total \space inches}{1} \times \frac{1\space yard}{36\space inches} = \frac{yards}{1}\] Then multiply your cost per yard for the total. \[\frac{total \space yard}{1} \times \frac{dollars}{1 \space yard} = \frac{dollars}{1}\]
Join our real-time social learning platform and learn together with your friends!