Feedback for these lessons is very much welcome. If you like or hate something about a lesson let us know, either on GitHub, via Mail or just tell us in person :)
x
Important importing - path path path
Step 1
Write two python files foo.py
and bar.py
. The foo
module will contain the main function, the bar
module will contain a function that takes two numbers and adds them, then divides the result by the first one1, and a variable called MY_CONST
with the value [4, 2]
.
In foo
import bar
. In the foo.main
function print the constant from bar
and a value calculated by the function in bar
.
Run it.
Step 2
Change the directory and call the foo.py
script from within another directory. What happens?
Step 3
There are three ways of fixing this problem, of which we learned two2. Try using both once.