Issue
When I enter the same code in a python IDE instead of the notebook it causes an error as expected.
Solution
The first thing that I could think of is you ran the cell earlier. From how I understand Google Colab, if you run the cell it stores that function/ 'remembers it' so if you re-run the cell it won't give an error.
Same reason why running a cell that changes data can only work once.
But I might be wrong.
As long as your code works I wouldn't worry too much about it. You can always place the function in a new cell above the one where you call the function. I would mainly do this because it looks better.
Answered By - AIDevLuca
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.