Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDmitry Manasreh
5,651 PointsHow to call a function in python not in workspaces ?
I want to make and call functions but not in workspaces , how ?
3 Answers
arpith pm
Courses Plus Student 107 PointsA humble request. Learn to google. Read the docs at times. Googling properly is the most loyal friend of a developer. I'm sharing here a link to the google search.
Long ago, I had an issue with my keyboard. If i press J it used to display U, for I it used to display B, etc. I was wondering how would I even google this.. :)
arpith pm
Courses Plus Student 107 Pointsas follows: def add (a,b): sum = a + b return sum
answer = add(4,5)
Dmitry Manasreh
5,651 PointsI mean I have saved a function in a python file then how can i call this from another one ?
arpith pm
Courses Plus Student 107 Pointsfile1.py def add (a,b): sum = a + b return sum
file2.py import file1.py print(add(4,5))