title: How to use replace function to replace a string exactly and not part of it?
body: <p>I am an absolute beginner in Python.I am creating a mad lib game which uses replace function to replace words in my template. The following code does not give correct output as template is not changed according to user input.</p>
  
  <pre><code>#!/usr/bin/env python
  print("lets play a game of mad libs")
  print("you will be asked for a word such as noun,adjective,etc.enter the specified word")
  
  template="""I can't believe its already word1! I can't wait to 
  put on my word 2 and visit every word3 in my neighbourhood.
  This year,I am going to dress up as word4 with word5 word6.
  Before I word7,I make sure to grab my word8 word9 to hold all 
  of my word10.
  Happy word11!"""
  
  word1=input("enter a  holiday")
  word2=input("enter a noun")
  word3=input("enter a place")
  word4=input("enter a person")
  word5=input("enter a adjective")
  word6=input("enter  body part (plural)")
  word7=input("enter a verb")
  word8=input("enter a adjective")
  word9=input("enter a noun")
  word10=input("enter  food")
  word11=input("enter a holiday")
  template=template.replace("word1",word1)
  template=template.replace("word2",word2)
  template=template.replace("word3",word3)
  template=template.replace("word4",word4)
  template=template.replace("word5",word5)
  template=template.replace("word6",word6)
  template=template.replace("word7",word7)
  template=template.replace("word8",word8) 
  template=template.replace("word9",word9)
  template=template.replace("word10",word10)
  template=template.replace("word11",word11)
  print(template)
  </code></pre>
  
  <p>I know I can use flow control loop but I am just understanding string manipulation. So please forgive my messy coding.</p>
  
  <p>The problem with output is that replace function replaces "word1","word10" and "word11" with same input of "word1" because "word1" is part of both.Is there anyway to avoid that instead of just changing name for "word10" and "word11".If not,what alternative to replace function should one use? </p>