-
Notifications
You must be signed in to change notification settings - Fork 23
Code only works after resetting kernel #27
Copy link
Copy link
Open
Description
Hi,
we were working on a task 3.3.3.4: of assignment 1 and produced the following code:
def my_func(element):
res1 = tuple(element.split('-'))
res2 = tuple([int(i) for i in res1])
return res2
my_func('1-11')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 :
TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_3364/4279762030.py in <module>
3 res2 = tuple([int(i) for i in res1])
4 return res2
----> 5 my_func('1-11')
~\AppData\Local\Temp/ipykernel_3364/4279762030.py in my_func(element)
1 def my_func(element):
----> 2 res1 = tuple(element.split('-'))
3 res2 = tuple([int(i) for i in res1])
4 return res2
5 my_func('1-11')
TypeError: 'tuple' object is not callable
Best,
Simon
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels