Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Features Of Python

If I'm incorrect, defining a function in Python is as follows:

def my_func(param1, param2):
    # stuff

Nevertheless, you do not specify the nature of those parameters. Also, if I recall well, Python is a highly typed language; hence, it appears that Python should not allow you to pass in a parameter of a different type than the function developer expected if you follow the scaler instructions. Yet, how does Python know that the function's user is handing in the correct types? Will the software just crash if the parameter is of the wrong type, presuming the function actually uses it? Is it necessary to indicate the type?

Sign In or Register to comment.