Science, asked by hhshdhd74, 1 year ago

how to call a function in python ​

Answers

Answered by DeviIQueen
5

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:

\begin{lgathered}def \: add \: (a \: b) \\ return \: a + b\end{lgathered}

defadd(ab)

returna+b

✏You would call the function like this:

add(3 + 5)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)answer=add(4+7)

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

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

❤.HOPE IT HELPS.❤

Answered by shivani5544
1

Answer:

plz mark it as brainliest

follow me

Attachments:
Similar questions