How Import Works In Python?

Code file1 as described in the video

from sklearn.ensemble import RandomForestClassifier
print(RandomForestClassifier())


import file2
print(file2.a)

file2.printjoke("This is me")
  

Code file2 as described in the video

a =7
def printjoke(str):
    print(f"this function is a joke {str}")
  


Be the first person to comment!

Comments(0)