-1

I already have the calculations part down but the output is what I'm struggling with. Here is a screenshot of my assignment with instructions for output format on right and code errors at the bottom

enter image description here

Jacob Lee
  • 4,405
  • 2
  • 16
  • 37
  • 2
    Please supply the expected [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) (MRE). We should be able to copy and paste a contiguous block of your code, execute that file, and reproduce your problem along with tracing output for the problem points. This lets us test our suggestions against your test data and desired output. Off-site links and images of text are not acceptable; we need your question to be self-contained, in keeping with the purpose of this site. When you post your code, we can probably help. – Prune Apr 28 '21 at 23:21
  • You seem to be misunderstanding how the pluses and commas work in the print statement. Concatenation only uses plusses. In Python, you cannot only add two strings together, so you must cast the integers – OneCricketeer Apr 29 '21 at 01:14

1 Answers1

0

I recommend reviewing string formatting in Python. This should do the job for the scenario you provided:

print(f"{x} months is {y} years and {m} months")
Carlos Melus
  • 1,472
  • 2
  • 7
  • 12