You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chapter 13 exercise 2
Hello,
For me it is still not very clear how to fix this exercise. Could you give me an explanation on how to do this?
Thank you so much!
The text was updated successfully, but these errors were encountered:
Exercise 2 of Chapter 13 is about creating two python files.
One is a module to be imported (i.e., my_utils.py) and the other is a script that you’ll run directly (i.e., my_second_program.py)
Yesterday during the lecture I created the two files as below:
my_utils.py:
importosimportdatetimefromrandomimportrandintdefget_current_directory():
"""Return the current working directory"""to_return=os.getcwd()
returnto_returndefget_current_time():
"""Return the current time."""returndatetime.datetime.now()
defget_random_int(low: int, high: int):
"""Sample a random integer from the uniform distribution (low,high)."""returnrandint(low, high)
foo='foo'bar= [1,2,3,4]
Make sure that both python files are in the same directory and your current directory in your terminal
is also the directory where the two files are located.
Run python my_second_program.py to see that this script successfully imports the module my_utils,
and do stuff.
Original question:
The text was updated successfully, but these errors were encountered: