How to take input till user wants in python?

I want to keep taking inputs and store it in a variable until the user wants. I know in C++ we can write like this,

while(cin>>u){
//code
}

but how to do it in python??

Comments (1)