go to next line in python code example

Example 1: new line in python

''' simple'''
print()
''' complex'''
print('\n',end='')

Example 2: go to line in python

def goto(linenum):
    global line
    line = linenum

line = 1
while True:
    if line == 1:
        response = raw_input("yes or no? ")
        if response == "yes":
            goto(2)
        elif response == "no":
            goto(3)
        else:
            goto(100)
    elif line == 2:
        print "Thank you for the yes!"
        goto(20)
    elif line == 3:
        print "Thank you for the no!"
        goto(20)
    elif line == 20:
        break
    elif line == 100:
        print "You're annoying me - answer the question!"
        goto(1)

Example 3: new line in python

print("line one\nline two") # the \n in python is used to create new lines in a string

Example 4: python continue to a new line

a = "This" + " is" + " a" + \
	" multi-line" + " statement"