title: Python code to create function with Reversed arguments
body: <p>How to write a function that returns the reversed arguments of a previous function? The function can return an int, char, string, etc. Examples:
  f=pow(2,3)=8 (original)
  g=pow(3,2)=9 (reversed arguments)</p>
  
  <p>capitalize_first_and_join first second third = FIRSTsecondthird (original)
  capitalize_first_and_join first second third = THIRDsecondfirst (reversed arguments)</p>
  
  <p>join_with coder best the are you = coder,best,the,are,you (original)
  join_with coder best the are you = you,are,the,best,coder (reversed arguments)</p>
  
  <p>The name of the function I need to create is reversed_args(f)</p>
  
  <p>Regards,</p>
  
  <pre><code>def reversed_args(f):
      # create the function here
  
      int_func_map = {
      'pow':pow,
      'cmp':cmp,
      }
  
      string_func_map ={
      'join with': lambda separator, *args: separator.join(*args),
      'capitalize_first_and_join': lambda first, *args: ''.join([first.upper()] + list(args)),
      }
  
      queries = int(raw_input())
      for _ in range (queries):
      line = raw_input().split()
      func_name, args = line[0], line[1:]
      if func_name in int_func_map:
          args = map(int, args)
          print reversed_args(int_func_map[func_name])(*args)
      else:
          print reversed_args(string_func_map[func_name](*args)
  
  
  
  
      f=pow(2,3)=8 (original)
      g=pow(3,2)=9 (reversed arguments)
  
      capitalize_first_and_join first second third = FIRSTsecondthird (original)
      capitalize_first_and_join first second third = THIRDsecondfirst (reversed arguments)
  
      join_with coder best the are you = coder,best,the,are,you (original)
      join_with coder best the are you = you,are,the,best,coder (reversed arguments)
  </code></pre>