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 (Retired) Putting the "Fun" Back in "Function" Introduction To Functions

Dhruv Ghulati
Dhruv Ghulati
1,582 Points

How to move to new line in shell (when defining functions?)

I want to know what you clicked on your keyboard to be able to define and tab in a new line in the shell. Thanks!

1 Answer

well most of the time you can do that using this one \, example:

print("hello " + variable + "again hello! " + variable2 +\
         "see ? " + variable3)

and you can also do this while defining long functions like:

def function(var1, var2, var3\
                     var4, var5, var 6):

dont forget that you can also move to another line while defining function automatically after typing : because this tells to python to move to a next line cause you are going to write something inside that

i hope this helps you and i hope that u mean this lol