- 1
Write two functions, one called addit and one called mult. addit takes one number as an input and adds 5. mult takes one number
My attempt: https://code.sololearn.com/cVh1CeHsQZ1V/#py
4 odpowiedzi
+ 2
Hello! Can you show us the attempt you have already made so we can help you? Please put your code into Code Playground so it's easy to read.
0
Your code is a little confused, so here is a bit of guidance:
You only need to take input once - write both the functions first, have addit take one parameter (let's say x), then inside the addit function have it call mult and pass both the input and result (x, y) to it. You can put a print statement inside each function, then you just have to call addit with input as the parameter.
Have another go and good luck!
0
Hope this will help you.
#CODE
def mult(x):
return x*addit(x)
def addit(x):
return x+5
#Explanation
the first function is giving result by multiplying what we got from the add function
and the add function is adding 5 and returning to what your input will be