Computer Science, asked by pushpendrau444, 9 months ago

it is mandatory to have -main- function to python​

Answers

Answered by hkdelavadiya
1

Answer:

Required arguments are the mandatory arguments of a function. These argument values must be passed in correct number and order during function call.

If you run the given code you get the following output

Hi 15

Traceback (most recent call last):

File "requiredarg1.py", line 4, in <module>

requiredArg('Hello')

TypeError: requiredArg() takes exactly 2 arguments (1 given)

EXPLANATION

In the output above for the first function call with two required arguments we get the output as Hi 15. But for the second function call with only one argument, we get a Type Error saying the function takes exactly 2 arguments. This shows the importance of required arguments and their mandatory nature

Explanation:

hope it is helpful to you

please mark as brainlist

Similar questions