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 Python Basics (2015) Python for Beginners Functions and Objects

function

def StartFirst() :
print("welcome to treehouse")

what is wrong in this code

Joshua Maggwa
Joshua Maggwa
199 Points

The "print" isn't indented like it's supposed to be

2 Answers

Umesh Ravji
Umesh Ravji
42,362 Points

Hi Kapil, please see the 'Markdown Cheatsheet' to see how you can format your code properly.

def StartFirst():
    print("welcome to treehouse")

I'm going to assume that your code is formatted properly, and the problem here is simply the space between the () and :

William Li
William Li
Courses Plus Student 26,867 Points

I've edited the question w/ proper markdown. As you can see, the original indentation is incorrect there.

hello Ravji Space between () and : was removed but it is still not working. what is that i am missing here. It is simple to use print function and print . why in this case it is not working Plz help

Umesh Ravji
Umesh Ravji
42,362 Points
def StartFirst():
    print("welcome to treehouse")

StartFirst()

You also need the indentation (indentation is really important in python), as William pointed out in another comment. Also, make sure you are calling the function if you aren't.

You must indent your code so,

def start_first(): print("Welcome")

you see my print() method indented inside the function :)