Results 1 to 4 of 4
  1. #1
    Sylasybn's Avatar
    Join Date
    Sep 2017
    Gender
    male
    Posts
    206
    Reputation
    11
    Thanks
    15
    My Mood
    Psychedelic

    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.")

  2. #2
    leacherxd's Avatar
    Join Date
    Jan 2017
    Gender
    male
    Posts
    128
    Reputation
    55
    Thanks
    20
    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.

  3. The Following User Says Thank You to leacherxd For This Useful Post:

    Sylasybn (01-14-2019)

  4. #3
    Sylasybn's Avatar
    Join Date
    Sep 2017
    Gender
    male
    Posts
    206
    Reputation
    11
    Thanks
    15
    My Mood
    Psychedelic
    Thank you very much that's exactly what i was tryin to figure out!

  5. #4
    Solvi's Avatar
    Join Date
    Sep 2014
    Gender
    male
    Posts
    3,268
    Reputation
    1567
    Thanks
    1,314
    @hell_demon @mikerósoft omg if u dont @ solved threads the programming lönge will go to chaos!!! gosh


Similar Threads

  1. Noob question.
    By Homedawg68 in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 12-14-2008, 05:35 PM
  2. Noob Question
    By JustKnowMe in forum General
    Replies: 5
    Last Post: 12-14-2008, 05:03 PM
  3. noob question
    By rambuki in forum WarRock - International Hacks
    Replies: 3
    Last Post: 01-15-2008, 01:09 PM
  4. Noob question
    By thedrowningfish in forum Visual Basic Programming
    Replies: 7
    Last Post: 12-04-2007, 08:22 AM
  5. Hacking world of warcraft? & a noob question
    By arsholio in forum General Game Hacking
    Replies: 9
    Last Post: 04-08-2006, 01:55 PM