build a string based on user's input python
You can take _type and _link as keyword arguments, and so would simply your code. This can be as simple as func(_type=None, _link=None). However you may want to only take them if they are keyword arguments, and that method would allow them to be passed as normal positional arguments. To do this you can use prepend * to the function to do this. And so you can use func(*, _type=None, _link=None).