What does this period change in the command line? I defined "list" as a variable, but why can’t I just use the "write" command?
[1]: https://i.stack.imgur.com/JpRPz.png
>Solution :
First, don’t name variables using python built-ins such as list.
Secondly, to answer your question, assigning a file pointer to the variable list creates an object (to put it vaguely) list. In python, methods can perform functions specific to an object type, such as the one assigned to list. In your case, the method is to write the contents supplied to write() to the file you opened. Methods are called upon using . following an instantiated object.