Fix Python – How do Python functions handle the types of parameters that you pass in?

Unless I’m mistaken, creating a function in Python works like this:
def my_func(param1, param2):
# stuff

However, you don’t actually give the types of those parameters. Also, if I remember, Python is a strongly typed language, as such, it seems like Python shouldn’t let you pass in a parameter of a different type than the function creator exp….

Fix Python – How to check if an object is a list or tuple (but not string)?

This is what I normally do in order to ascertain that the input is a list/tuple – but not a str. Because many times I stumbled upon bugs where a function passes a str object by mistake, and the target function does for x in lst assuming that lst is actually a list or tuple.
assert isinstance(lst, (list, tuple))

My question is: is there a better w….