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 trialMorningstar Ndlovu
3,732 PointsI'm stuck here how do i tackle this one
The code in the using_a_function.py is making use of an external function named tweet.
The code here is intended to make a console based application that sends tweets. I've written the first part for you.
1 Answer
Morningstar Ndlovu
3,732 Pointsdef function("tweet"): print("What would you like to tweet? ") print("Hello this is my tweet") print("this is outside the function")
function("tweet")
Steven Parker
231,269 PointsIt's hard to know what your exact objective is without a link to the course page. But a few things I spot already:
- this defines a function named "function", was that your intention?
- the parameter name in a function definition should not be in quotes
- this function appears to be asking a question but it does not take any input
- the instructions talk about "use of an external function named tweet" but this code doesn't do that
For the most specific help, please provide a link to the course page. And when posting code, to preserve the layout (including indentation) use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. Or watch this video on code formatting.
Steven Parker
231,269 PointsSteven Parker
231,269 PointsTo make it easier to help you, be sure to include the code you have so far (at least give it a "good faith" try) and a link to the course page you are working with.