Open simull opened 2 years ago
Hi @simull
Looks a bit weird.
Could it be that you have defined tuple
to be equal to some tuple and therefore when you apply tuple
to the list it raises an error?
Try to send the whole notebook of yours for context :)
Cheers Jonas
Hi Jonas,
thanks for your response. I don't think it has anything to do with the code, because after I restarted the kernel the same code went through. So after restarting the kernel, I can no loner reproduce the issue and without error, it is hard to look why that happened.
Best, Simon
Hi @simull
It depends on what you have defined the variables in your (global) namespace to be. It could be that before you restarted your kernel you wrote somewhere in a cell that
tuple = tuple(list("ABCDEF"))
Then the variable tuple
, which normally has the builtin function tuple
assigned to it, would have a tuple object assigned instead of the builtin function.
When you apply tuple
to the list in your function it will raise an TypeError
saying that tuple
is not callable, because tuple
is not the builtin function but a tuple object.
If you then restart your kernel the global namespace will reset and tuple
will again become the builtin function. With the global namespace reset to its default (and without running the line of code above) your function will work without any problems.
At least this is what I think is the most likely explanation to your now disappeared error :)
Hi,
we were working on a task 3.3.3.4: of assignment 1 and produced the following code:
This is a code I also produced and it always returned an Error. However, the same code works for the others in my group. It only worked for me, when I restarted the kernel. How should I know that I have to restart the kernel and stop changing and working on the code that should already work?
I got the following Error :
Best, Simon