Q:

use of while True in code

I'm a relatively new programmer and many a times I have seen expert programmers writing a piece of code under the expression
while True

I am confused what significance does it make? Is it used to execute that part of code which is necessary to be executed or is it just a convention?

A:

In some cases it is desirable, for the condition to always evaluate to true, creating an infinite loop.
while(true)
{
    //do your work here in loop
}

When such a loop is created intentionally, there is usually another control structure (such as a break statement) that controls termination of the loop. For example:
while (true) 
{
   //do complicated stuff
   if (someCondition) break;
   //more stuff
}

