Closed AkselSB closed 3 years ago
I was also confused by this exercise.
Hey Amalie and Ondskabsfyrsten
I was wondering about the same thing but figured out in the end how to solve the problem. The solution is actually very simple (as I understand). They want you to define an exponentiate function that can take any other functions as an input (the input variable in their example is called func). Hence, natural_logarithm is a function than can be used as an input in this case. In other words you should end up with exponentiate(natural_logarithm) which you equal to logexp. I hope it helps. Note, make sure to run the eulers_e in problem 0.3.3 and natural_logarithm in 0.3.4, otherwise the program would not be able to recognise these functions.
Hey Konstantin,
Thanks a ton! Unfortunately, the query is still giving me problems. I might not have understood the previous bit properly, which makes it difficult to see what is wrong for me. Hope you can help:
Thank you in advance
Hi @Ondskabsfyrsten,
So there are basically two things that you need to do here:
#[FILL IN]
should be replace wiht. The answer is basically given to you in the question: _The nested function should return func(e, k)
where e=eulers_e(x, k)
_. As we can see in the code snippet, the nested function returns value, so therefore value should be equal to...?exponentiate()
takes a function as input. Now, in the question, we are essentially asking you to try and use natural_logarithm
as this input. Try this out and store this object as logexp
. What will now happen if you write logexp(1, 100)
?And thank you for the helpful comment, @Konstantin-Babayan.
Best, Joachim
Hi @Ondskabsfyrsten
Regarding your second comment: Try and switch exponentiate(natural_logarithm)
and logexp
on each side of =
. Does this help?
Best, Joachim
Hi @joachimkrasmussen
I've switched around exponentiate(natural_logarithm) and logexp but I'm still confused regarding what has to be stored with value. :
Thank you in advance
OK, there there seems to be two problems here:
answer_035
and logexp(1,100)
. When you create a new object (here answer_035
), you need to put that new object before =
. Then after the equality sign, you specify the object (in this case as logexp(1,100)
.function()
is, as this has not been specified anywhere. However, it know what func()
is, as this was the input in exponentiate. Can you use this information somehow?Best, Joachim
I think I worked it out. Thank you for the patience!
Hello
I'm confused about the notion of "calling" a function. Looking up tutorials I see it allows me to link(?) functions together, but I'm not sure how the 'exponentiate' and 'natural_logarithm' variables should be connected. The wording is confusing.
Thanks in advance