The phrase can also be used to ask a question. For example, if someone is trying to figure out how to do something, they might ask "What in the world am I supposed to do?"
In some cases, the phrase "what in the world" can be used to express anger or irritation. For example, if someone is driving and someone else cuts them off, they might say "What in the world is wrong with that person?"
Overall, the phrase "what in the world" is a versatile phrase that can be used to express a variety of emotions and thoughts.