0

How can I combine these two lines so the output shows both results next to each other instead of on separate lines? I've tried multiple things but can't get it to work.

print(data.get('unit').get('type'))
print(data.get('unit').get('name'))

If I do:

print(data.get('unit').get('type'), data.get('unit').get('name'))

it will only return one value either type or name

Andrew Morton
  • 24,203
  • 9
  • 60
  • 84
w999
  • 11
  • 1
  • `print(data.get('unit').get('type'), data.get('unit').get('name'))`? – MattDMo Apr 09 '22 at 18:11
  • 1
    Does [How to print without a newline or space](https://stackoverflow.com/questions/493386/how-to-print-without-a-newline-or-space) help? – Andrew Morton Apr 09 '22 at 18:13
  • Does this answer your question? [How to print without a newline or space](https://stackoverflow.com/questions/493386/how-to-print-without-a-newline-or-space) – Maicon Mauricio Apr 09 '22 at 19:17
  • Does this answer your question? [Print multiple arguments in Python](https://stackoverflow.com/questions/15286401/print-multiple-arguments-in-python) – Omar Tammam Apr 10 '22 at 14:19

0 Answers0