print ( "Welcome to the tip calculater:-" ) bill = float ( input ( "What is the bill:- $" )) per = int ( input ( "What percentage of tip you want to give?:-" )) up_per = per / 100 tip = bill * up_per total_bill = bill + tip total_amount = round (total_bill, 2 ) print ( f"The total bill is $ { total_amount } " ) split = int ( input ( "How many persons to split the bill:-" )) split_amount = total_bill / split final_amount = round (split_amount, 2 ) print ( f"Each person have to pay $ { final_amount } " )
Definition of HTML (Hypertext Markup Language) Full form:- HTML (Hypertext Markup Language). It is the language used to create web pages. Examples:- <html> <head> <title> First Web page</title> </head> <body> This is my first html page </body> </html>
Look, I used to hate building APIs. All that manual JSON serialization, writing the same CRUD views over and over, authentication headaches - it was exhausting. Then I tried Django REST Framework. What Changed? DRF takes all the repetitive stuff and automates it. Here's what sold me: Serializers handle everything. They convert your models to JSON, validate incoming data, and even handle nested relationships. No more manual data munging. ViewSets are magic. Write one ViewSet class and get full CRUD endpoints automatically. Need custom behavior? Just add a method. That's it. Authentication actually works. Token auth, session auth, JWT - pick one, add two lines to your settings, done. A Quick Example This code gets you a complete API: class PostSerializer ( serializers . ModelSerializer ) : class Meta : model = Post fields = '__all__' class PostViewSet ( viewsets . ModelViewSet ) : queryset = Post . objects . all ( ) seri...
Comments
Post a Comment