title: Question about python module and calling a function from it
body: <p>So I have been wracking my brain trying to figure this out for like 2 hours. As I understood it, when I define a module with functions, and move to a new file, I can import that module. Then to call a function from that module I can do something like module_name.function_name(inputs). Note that there is only one period!</p>
  <p>So, there is a module called itertools. When I import <code>itertools</code>, I can call <code>itertools.chain</code>(list or list of lists) and it will create an iterator object for me. HOWEVER, now this is the part I don't get, I can ALSO call <code>itertools.chain.from_iterable</code> and it will ALSO create a different iterator object for me. I dont get how this is possible? How can <code>itertools.chain</code> and <code>itertools.chain.from_iterable</code> both be functions that return something, and how would I go about creating a module like that?</p>
  <p>How can there be 2 periods in 1 function call when the stuff before the first period isnt a class?
  (I can also import classes from a module and then call methods defined within the class using Class_name.method_name(inputs). however I'm pretty sure chain is a function and not a class because it returns an output!!)</p>