Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

I'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.

Steven Parker
Steven Parker
221,451 Points

To 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.

1 Answer

def 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
Steven Parker
221,451 Points

It'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. :arrow_heading_down:   Or watch this video on code formatting.