I am trying to put in 2 inputs then get them as an output, but I cant seem to get a space between them at the end . I have tried a + sign, space between x and y, and a comma and none work.
Asked
Active
Viewed 1,481 times
-5
-
Post text, not images of text. – Joseph Sible-Reinstate Monica Dec 04 '19 at 03:06
-
Welcome to Stack Overflow. Please read [ask] and [Why is "Can someone help me?" not an actual question?](https://meta.stackoverflow.com/q/284236/354577) – ChrisGPT was on strike Dec 04 '19 at 03:08
-
[Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577). They can't be searched or copied and offer poor usability. Instead, paste the code as text directly into your question. If you select it and click the `{}` button or Ctrl+K the code block will be indented by four spaces, which will cause it to be rendered as code. – ChrisGPT was on strike Dec 04 '19 at 03:08
1 Answers
1
A formatted string will work nicely here.
We can provide variables to a string that has special format markers, like so:
print('{0} {1}'.format(word1, word2))
Or, more easily, a string concatenation:
print(word1 + ' ' + word2)

dddJewelsbbb
- 626
- 4
- 17