title: How do I use input from one function in a different function?
body: <p>Can someone explain to me how I can use the input from one function in another? I have seen different questions but it doesn't make any sense to me: <a href="https://stackoverflow.com/questions/7129285/what-is-the-purpose-of-the-return-statement">What is the purpose of the return statement?</a></p>
  
  <p>I am trying to use the input here as the sides of a triangle. The next function should get that input and use it to get the perimeter. I want to be able to use those three sides later on in another function. This is what I have:</p>
  
  <pre><code> #Input Func. using map
   def u_input_map():
       print("Enter the length of all sides")
       lengths  = input("Please enter enter the length of all sides in this
       format: a, b, c ").split(',')
       sides = list(map(int, lengths))
       print(sides[0],sides[1],sides[2])
       return(sides)
   u_input_map()
  
   # Triangle Perimeter Func.
   # P = a + b + c
   def perim(u_input_map):
       all_sides = (sides[0]+sides[1]+sides[2])
       print(all_sides)
       return sides
   perim(u_input_map)
  </code></pre>
  
  <p>I just want someone to point me in the right direction. I want to figure this out on my own so I don't need the code.</p>