Let's say I have a user input a string.
string = input("enter a string")
and that string ends up being something like "hello world!" but with a lot more whitespace.
string = "hello world!"
I want to condense this user's input so that instead of all that whitespace I only get one piece of whitespace ("hello world!") so that I can then replace the whitespace with an underscore ("hello_world!"). How might I go about doing this?