• and a variation of the above, which is the 'hardest' in the document:

    first = input("Enter the first number, (0 to finish): ")
    firstint = int(first)
    a = ""
    finished = False
    while not finished:
        next = input("Enter the next number, (0 to finish): ")
        nextint = int(next)
        if nextint == 0:
            finished = True
        elif nextint > firstint:
            q = "Up"
            a = a+" "+q
            firstint = nextint
        elif nextint == firstint:
            q = "Same"
            a = a+" "+q
            firstint = nextint
        elif nextint < firstint:
            q = "Down"
            a = a+" "+q
            firstint=nextint
    print(a)
    

    1 Attachment

    • Screen Shot 2017-04-06 at 21.43.40.png
About