Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python list .remove 
Python :: run python script on android 
Python :: make a condition statement on column pandas 
Python :: how to make a clock in python 3 
Python :: decode binary string python 
Python :: python calculator file size to megabytes 
Python :: fibonacci sequence in python 
Python :: all() python 
Python :: SciPy Convex Hull 
Python :: tkinter delete toplevel 
Python :: fibonacci recursive python 
Python :: how to use query_params in get_object djangorestframework 
Python :: get country from city python 
Python :: download pytz python 
Python :: range(len()) in python 
Python :: matplotlib savefig legend cut off 
Python :: pillow image from array 
Python :: get input on same line python 
Python :: httplib python 
Python :: python file write 
Python :: convert negative to positive in python 
Python :: list of dicts 
Python :: find number of unique keys in the dictionary 
Python :: python casting 
Python :: python add attribute to class instance 
Python :: chatbot using python github 
Python :: all the symbols on a keyboard python list 
Python :: python new date 
Python :: rolling window pandas 
Python :: plotly pie chart in pie chart 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =