1. Historical Values in Python

    Often in programming we have some "constant" value that we define as a variable in Python. But the only try constant is change.

    Consider for example you have a program that needs to process a file with a certain filename. So you might have something like:

    FILENAME = "foo.txt"
    
    data …
    Tagged as : development python
  2. Python Cannot Return Multiple Values

    It is often said that Python functions can return multiple values, but this isn't really true. Often the examples given to show Python returning multiple values is something like this:

    def foo():
       return 1, 3
    
    a, b = foo()
    

    But is that really returning multiple values? No. Well then how come …

    Tagged as : development python

Page 1 / 1