Adding two number isn't working on heroku
Question: Why this code is not running on heroku? (Internal server error)

    
    
    import os
    from flask import Flask
    
    app = Flask(__name__)
    
    @app.route('/')
    
    def hello():
        a = 10
        b = 20
        c = a + b
        return c
    
    if __name__ == '__main__':
        # Bind to PORT if defined, otherwise default to 5000.
        port = int(os.environ.get('PORT', 5000))
        app.run(host='0.0.0.0', port=port)
    

Logs:

Starting process with command `python app.py`  
a = 1  
^  
SyntaxError: invalid syntax  
File "app.py", line 8

This code is working (Python hello world from heroku guides)

    
    
    import os
    from flask import Flask
    
    app = Flask(__name__)
    
    @app.route('/')
    
    def hello():
        return 'Hello World!'
    if __name__ == '__main__':
        # Bind to PORT if defined, otherwise default to 5000.
        port = int(os.environ.get('PORT', 5000))
        app.run(host='0.0.0.0', port=port)
    


Answer: Sounds like that not your code is being executed. After all your line was `a =
10` and the log file complains about a line stating `a = 1`.

Or maybe there's a strange (invisible?) character between the `1` and the `0`.

I'd propose to change that value from `10` to `42` for testing and see in what
way the error log message changes.

