Computer Science, asked by Anonymous, 10 months ago

How to call a function in python?​

Answers

Answered by cutegirl24254
7

⭕HØLA DEAR⭕

✏When you call a function, you are basically just telling the program to execute that function. So if you had a function that added 2 no. such as:

def \: add \: (a \: b) \\ return \: a + b

✏You would call the function like this:

add(3  + 5)

✏Which would return 8.You can put any 2 numbers in the parentheses in this case. You can also call a function like this:

answer = add(4 + 7)

✏Which would set the variable answer equal to 11 in this case.

 \huge \mathtt \pink{thank \: you}

❤.HOPE IT HELPS.❤

Answered by 3CHANDNI339
12

▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬

♥️____________________________

step 1 Declare the function with the keyword def followed by the function name.

Step 2: Write the arguments inside the opening and closing parentheses of the function, and end the declaration with a colon.

Step 3: Add the program statements to be executed.

♥️____________________________

▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬

Similar questions