Why do we not need to define the parameter type in python?

Why do we not need to define parameter type in python?and since it is not taking parameter type how does it determine what those parameters are?
For example say we have a variable n and we pass it as parameter

def function(n)

Now how will python determine if it is a string or integer or something else?what if the user input the wrong data type?

Hey @Nitin-Bhattacharyya-2319140631658033, your doubt is quite genuine, but you should have asked it earlier, when knowing that in python we also need not to mention the data type as in like int c = 5. We directly mention c = 5 in python and if you print type© it will give output. Also we can change the data type of c in very next line c = ‘hello’ then type© will be string. So this is the language specific thing. In python we need not to mention data type, variable can change data type as well.

Actually it does not. You can pass anything or any data type to it.

In that case simply an error pops up at runtime.

Hope this resolved your doubt. :blush:

thanks for resolving it

Hey @Nitin-Bhattacharyya-2319140631658033, You’re Welcome. Plz mark the doubt as resolved as well in my doubts section. :blush: