Python Flask Basics Welcome to Flask Request args

adam knapp
adam knapp
1,551 Points

get name from request

I am having trouble with the challenge question to get a name from the request. My code is below.

rom flask import Flask from flask import request

app = Flask(name)

@app.route('/') def index(name='Adam'): name = request.args.get('name', name) return "Hello from {}".format(name)

flask_app.py
from flask import Flask
from flask import request

app = Flask(__name__)

@app.route('/')
def index(name='Adam'):
    name = request.args.get('name', name)
    return "Hello from {}".format(name)