To create a Flask app that multiplies two numbers, follow these steps:
Install Flask using pip install Flask
command in your command prompt or terminal.
Create a new file app.py
in your directory and add the following code:
main.py411 chars14 lines
Run the app.py
file using the command python app.py
in your command prompt or terminal.
Open your browser and go to http://localhost:5000/multiply?num1=5&num2=10
(or any other numbers you want to multiply). You should see 50
as the result on the screen.
That's it! You have successfully created a Flask app that multiplies two numbers.
gistlibby LogSnag