Importing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Importing

Is it possible to import the function of another code you have written into a separate code? I’m using Python.

20th Apr 2018, 4:35 AM
Nathan Lewis
Nathan Lewis - avatar
4 Answers
+ 3
it doesnt work on sololearn only on actual python.
20th Apr 2018, 9:29 AM
Markus Kaleton
Markus Kaleton - avatar
+ 1
Just use “from NameOfCode import NameOfFunctionOrClass” above the rest of the code It can be imported like any normal library
20th Apr 2018, 5:10 AM
Ariela
Ariela - avatar
0
This doesn’t seem to work in SoloLearn, am I missing something?
20th Apr 2018, 6:02 AM
Nathan Lewis
Nathan Lewis - avatar
0
Okay, that’s what I thought! Thanks!!
20th Apr 2018, 12:17 PM
Nathan Lewis
Nathan Lewis - avatar