I am new to Python and programming itself. I have got my working directory in ""'C:\\Users\\dell\\Desktop\\Python Practice'"". I have got a file "Python Basics.ipynb" in which I am working and it is saved in working directory. Now I have created a module with name Calc.ipynb in same working directory and this Calc has few functions which I want to call from "Python Basics.ipynb". But I am getting an error. Coding details below:
*******Calc.ipynb********************
******"Python Basics.ipynb"**********************
###first I tried below code
ModuleNotFoundError
Then I tried following code :
---------------------------------------------------------------------------
ModuleNotFoundError
Please guide where I am going wrong..
*******Calc.ipynb********************
def sum(a,b): return a+b def sub (a,b): return a-b def mul (a,b): return a*b def div (a,b): return a/b****************************
******"Python Basics.ipynb"**********************
###first I tried below code
import Calc a = 9 b = 7 c = Calc.sum(a,b) print (c)Error/Response from system on execution:
ModuleNotFoundError
Error:Traceback (most recent call last)
<ipython-input-91-7f3fd0194649> in <module>
1 ## Modules - very importnat -- can create another file for my functions-- and then these funcitons can be called in my program
2 ## here - I have created a separate module as the new file in same folder directory- it will have few of the required funcitons
----> 3 import Calc
4 a = 9
5 b = 7
ModuleNotFoundError: No module named 'Calc'
---------------------------Then I tried following code :
from Calc import * a = 9 b = 7 c = sum(a,b) print (c)error is:
---------------------------------------------------------------------------
ModuleNotFoundError
Error:Traceback (most recent call last)
<ipython-input-87-bf78db7caed4> in <module>
----> 1 from Calc import *
2 a = 9
3 b = 7
4 c = sum(a,b)
5 print (c)
ModuleNotFoundError: No module named 'Calc'
**************************************Please guide where I am going wrong..