16 lines
282 B
Python
16 lines
282 B
Python
from flask import Flask, render_template
|
|
|
|
import random
|
|
app = Flask(__name__)
|
|
|
|
@app.route('/')
|
|
def index():
|
|
coin = random.random()
|
|
if coin >= 0.5:
|
|
return "Lucky you!"
|
|
else:
|
|
raise Exception("Bad luck")
|
|
|
|
if __name__ == '__main__':
|
|
app.run(debug=False)
|