0

How can I get two outputs to print on the same line?

Wrote the following code to practice OOP. The output is "Dekkion is a gold dragon" on the first line and "who breaths fire" on the second line. How can I get them to print next to each other (on one line)? I tried "\n.join" and other various Google answers, but no dice. Any help appreciated class dragon: def __init__(self, color, weapon): self.color = color self.weapon = weapon Dekkion = dragon("Dekkion is a gold dragon", "who can breath fire") print(Dekkion.color) print(Dekkion.weapon)

11th Apr 2019, 10:50 PM
tristach605
tristach605 - avatar
3 Answers
+ 3
Also try the search function. See the answer by David Ashton https://www.sololearn.com/Discuss/1439461/?ref=app
12th Apr 2019, 3:54 AM
Louis
Louis - avatar
+ 2
print(Dekkion.color, Dekkion.weapon)
11th Apr 2019, 11:20 PM
Diego
Diego - avatar
0
Thanks Louis and Diego:)!
12th Apr 2019, 9:19 PM
tristach605
tristach605 - avatar