 Hi everyone, in this tutorial we're going to talk about that, how to create infinite loop in Python and when to use it. But first, let's answer to the question what infinite loop is. Infinite loop is loop that keeps on executing forever. Infinite loop happens when loop condition is always true. How can we create an infinite loop? Well, I will repeat again. Infinite loop happens when loop condition is always true. So we need to use a loop. For example, we can use while loop and we need to provide a condition which is going to be always true and then inside this while loop, we're going to put some code in a code block and that code is going to be indented in while loop and this code block is going to be executed forever. Some examples of infinite loop are while one. Here we have condition one and one is number that is always true in Python. So if we put some code block in this while loop, that code block is going to loop forever or until we make a break from that loop. Similarly, we can use as condition keyword true. This keyword true provide us again condition which is going to be always true and again we can put inside code block anything that we want to be looped forever. I'm going to type these examples in Python idle so you can type while loop with condition one which always going to be true and inside it you can put anything in the code block. I'm going to keep it simple. For example, I'm going to print something forever. Let's say that I want to print this forever and if we want to stop this infinite loop, we're going to break this code. Also you can define some more complex condition which is going to be always true. For example, let's say that x is equal to one and let's make condition while x is greater than zero which is going to be true every time, every single time and we're going to have again an infinitive loop. Okay, let's say a few more words about this topic. For example, when we're going to use infinite loop, first we can use it when we want to provide a service to run indefinitely. For example, we can create a web server of a program that provides a service. Let's say that we have few client computers and these computers send out requests to a server on the network. And server is going to look at these requests and then it's going to send response. The main thing that we need to notice here is that web server is getting requests from clients in an infinitive loop. So if we have a server, we're going to provide an infinitive loop and in this infinitive loop, our server is going to get requests from clients and if our server is in the situation to send some response to these requests, then it's going to send response. Then also you can see that a lot of programmers often use infinite loop when they're creating a game. For example, just simple rendering images to the screen requires from us to have an infinitive loop with which we're going to render images during the gameplay. In this example, infinitive game loop is going to keep rendering of these sprite images over and over again while we're playing this game. And often where you're looking at other developers code, you can find that in game loop, very often we have a variable that's called running and that variable has value true and main game loop is created in format while running and inside this loop goes all game code which is going to render images and so on while we're playing that game and finally when our game is over, we're going to break this loop by making that the value of variable running becomes false which means that this while loop and code inside it is not going to be executed anymore. That's all in this tutorial. We've talked briefly about that, how to create infinite loop in Python and when to use it in your code. Don't forget to subscribe to my channel. See you in the next video.