Python noob question

Posts 14 of 4 · Page 1 of 1
Python noob question
Just practicing I'm new to this. Everything runs fine i was wondering
if there is a way to combine adjjective1/2 together without breaking it?
I appreciate any info.
Code:
adjective = input("enter adjective here")
adjective2 = input("enter adjective here")
type_of_bird = input("what kind of bird")
room_in_a_house = input("room in a house")
verb1 = input("verb(past tense)")
verb2 = input("verb")




print("It was a " + adjective + ", cold November day. "
      "I woke up to the " + adjective2 + " smell of " + type_of_bird +
      " roasting in the " + room_in_a_house + " downstairs. I " + verb1 +
      " down the stairs to see if I could help " + verb2 + " the dinner.")
For this type of mad-lib program, I'm assuming youre asking how to concatenate two strings. In python you can do this by just doing
Code:
print("Concatenated strings: " + str1 + str2)
Python reads the addition operator (+) as a string concatenator when there's two strings around it.
However because I think you're going to need spaces around the words, you can do
Code:
print("Two strings with a space between them: " + str1, str2)
This will put a space between them so that it looks good in a sentence.
Thank you very much that's exactly what i was tryin to figure out!
@hell_demon @mikerósoft omg if u dont @ solved threads the programming lönge will go to chaos!!! gosh
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?