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 trial

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,386 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,868 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,386 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 :)