42.2k views
1 vote
If the formal parameter list of a function is empty, the parentheses after the function name are not needed. answer choices. True. False.

1 Answer

4 votes

Answer:

Step-by-step explanation:True.

If a function has an empty formal parameter list, the parentheses after the function name are not required in some programming languages. For example, in Python, the parentheses can be omitted when defining or calling a function with an empty parameter list.

For instance, the following function definition and function call are both valid in Python:

def print_hello():

print("Hello!")

print_hello()

However, some programming languages, such as C and Java, require parentheses for all function definitions and calls, even when the parameter list is empty.

User Yumarx Polanco
by
7.2k points