Posts

Showing posts from June, 2020

API in Flask - REST API in Python

Image
APIsAPIs are something awesome.I personally love to talk about it.API are nothing but a piece of code which eases the software development process.On this you may think how this happens.So if you lool at our website we have also use many APIs such as the Chat System , Push Notification - What are these - These are nothing but the examples of API.If you still are not able to grab it , So for you I am going to narrate a story to you:You might have heared about third party applications like goibibo and makemytrip both are Flight Booking's site.Suppose when you search for a flight between City A to City B you are presented with many results from different airlines.So how this happens.Does goibibo or makemytrip has the permission to access the databases of indigo or air india.The answer is absolutely no.As no such reputed company would take a risk of giving the access to it's databases to such third paries.So again the question arises how these sites gets the results of flights arr…

Python program to find greatest number in 5 input numbers using functions?

Image
In this blog we are going to see how we can find a greatest number if 5 numbers are taken as input using a simple function.




#Python Program to find maximum number using a function def greatest(a,b,c,d,e): list1 = [a,b,c,d,e] print(max(list1))
greatest(20,6,7,28,9)

Python program to accept a character?

Image
In Python we don't have any data type called Character as in Programming Languages like Java , C and C++.Now how we can take a character as input in Python.First of all think what is string.String is a sequence of character or list of character.Now if String is a List then we can access the individual characters by their index number.


#Python Program to input a character character = input("Enter your character:")[0]#first character of string print(character)


--Thanks for Reading--

How does break, continue and pass work in python?

Image
First of all I would like to say that you should have the knowledge of loops before reading this.In this article we will discuss loops in short to help you understand this concept in better way.Loops are often called Iteration statement those statements which repeats specific number of times or based on specific condition.for loops and while loops are the loops supported in python.
Break statement is used when the programmer need to terminate a part of loop.It is a very useful statement.  Continue statement is used when you have to perform an iteration certain number of times and after the completion of iteration the other statements are executed.Pass is only supported in Python Programming Language.While Programming is python you often need to declare variables and functions explicitly but they actually don't need to be placed in the syntax and as we have to leave them empty that'swhy they create error.So Pass statement can be used there.

What are python modules? Name some commonly used built-in modules in Python?

If you are coming from Java background you might be knowing about packages and APIs which are nothing but a normal package already being developed with the JDK.Now what they do they are used to do some special things in programming.Such as java.io.Math which is used for Mathematical calculations in java.Similarly in python we have modules and modules are also same as packages i.e they are python file which are imported in other files to get the functionality of that file to the file in which we are currently working.we can easily create our own modules in python very easily by making a python file.There are a lot of python modules such as time,os,sys which are used to perform different utilities.

What is the difference between list and tuples in Python?

Our today's topic is what's the difference between list and tuple in python.In order to understand this you first need to know what are lists and tuple in python.List and tuple are used as arrays in python.Lists are surmounted by square brackets while tuple are surmounted by paranthesis that is the basic visible difference between Lists and Tuples.        Now what are the programmitical difference between a List and a Tuple.According to official documentation Tuples are immutable i.e you cannot change the number of elements or the elements itself in a tuple on the other hand Lists are mutable i.e. changeable and we can add or remove items in a List.In python as arrays are not supported we use Lists as arrays which works the same or even better and many functionalities are already implemented.

Thanks for Reading

Popular posts from this blog

5 Best Java frameworks

Top 20 Awesome Projects in Python