Goal: Create a python code for a webpage with the button to generate random number between 1 & 15 and display the number on the screen.
STEP1: First, create a new Python file called app.py and install Flask:
STEP2: Create two HTML files inside a new folder called templates: home.html and generate.html.
home.html
generate.html
STEP3: Run the application by running the following command in the terminal:
STEP4: Visit http://localhost:5000 in your browser and click on the "Generate" button to generate a random number between 1 and 15. The generated number will be displayed on a new page.
18-Mar-2023
Comments
Post a Comment