title: Lists and indexes gives error because list out of range
body: <p>I get an error when I try to run my funtion.
  I know the reason. but I search a way to fix this.</p>
  
  <pre><code>list2=['name','position','salary','bonus']
  list3=['name','position','salary']
  
  
  def funtionNew(list):
      print(len(list))
      po= '{} {} {} {}'.format(list[0],list[1],list[2],list[3])
      print(po)
  
  
  funtionNew(list3)
  </code></pre>
  
  <p>So that I can make this for list2</p>
  
  <pre><code>po='{}{}{}{}'..format(list[0],list[1],list[2],list[3])
  </code></pre>
  
  <p>and make this for list3</p>
  
  <pre><code>po='{}{}{}'..format(list[0],list[1],list[2])
  </code></pre>