# Write a python code which creates a server which guesses a number between 1 and 11, and then responds to https requests to say if they got the guess right or wrong.
# It should be a server that can handle http requests and understand json data.
importrandom
fromflaskimportFlask,request,jsonify
app=Flask(__name__)
# Generate a random number between 1 and 11
secret_number=random.randint(1,11)
@app.route('/guess',methods=['POST'])
defguess_number():
data=request.get_json()
if'guess'notindata:
returnjsonify({"error":"Please provide a 'guess' in your request"}),400