CHECK THE WEB PREVIEW OF THE API(IF WORKING) :- http://127.0.0.1:5000/armstrong/2345
To check whether a number is Armstrong or not . Follow the format to input data/number :- http://"YOUR SERVER IP"/armstrong/YOUR INPUT DATA Eg :- http://127.0.0.1:5000/armstrong/2345
What is Armstrong number ? Ans : An Armstrong number is an integer such that the sum of the cubes of its digits is equal to the number itself. Example :- 0, 1, 153, 370, 371 and 407 are an Armstrong number.
What is flask and why it is used? Ans : Flask is a web framework. This means flask provides you with tools, libraries and technologies that allow you to build a web application. This web application can be some web pages, a blog, a wiki or go as big as a web-based calendar application or a commercial website.
What is REST API and why it is used? Ans: A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.
What does flask's Jsonify () do? Ans : The jsonify() function in flask returns a flask. Response() object that already has the appropriate content-type header 'application/json' for use with json responses. Whereas, the json. dumps() method will just return an encoded string, which would require manually adding the MIME type header.
Before running this code make sure you have python installed in your PC and flask installed in your VS Code . To install Flask run this command in the VS Code terminal : pip install flask