My teacher has asked me to "Display all amounts in currency format with the $ sign right up against the first digit and two decimal places."
The code is:
How would I do what he asked?
The code is:
Code
# program2_3.py
# by Will Patterson (SPC ID: 209479)
# Prompt user for the value of Kenny's estate
# For Stan, divide the value by 1/2
# For Kyle, use the value of Stan and multiply it by 0.66666666666
# For Butters & Wendy, take the estate value and then subtract the total of Kyle and Stan's total value.
# Take Kyle & Stan's subtracted value from the value of Kenny's Estate then divide it by 2.
# Print out each of there values
def main():
# get the users input for the value of Kenny's estate.
estate = float(input("What is the value of Kenny's estate?: "))
# divide the value by 2 (1/2)
stan = (estate) / 2
# multiply Stan's value by 0.66666666666 (2/3)
kyle = (stan * 2/3)
# add the total the value of Stan & Kyle then subtract it from the estate value
sk = estate - (stan + kyle)
# divide the total of the variable sk by 2
bw = (sk) / 2
# print out Stan
print('Stan receives a total of: $'+str(stan))
# print out Kyle
print('Kyle recieves a total of: $'+str(kyle))
# print out Butters & Wendy's total
print('Butters and Wendy each get $'+str(bw))
main()How would I do what he asked?


