Question: I'm trying to implement a simple paging system with c# and cosmos on my Vue front end, but i'm not really sure the best way to implement a the paging when the user wants to go back.

For going forward i'm using the continuation token, so cosmos know where i have got up to, but i'm not really sure on the best way to work this going backwards, or if the user goes from page 1 to 3, then back to page 2?

Will i have to cache the results as the user pages through the items, or is there another way to accomplish this?

Answer: 
There's an easy fix. But first, the code, as posted above, does not work. Since ROLL is a string, the numbers in the if/elif statements need to be strings, too.

The solution (one easy solution) is to have an extra if statement for the "quit" case and then finish the while loop early using "continue", like so:

```
import random
ROLL = ''

while ROLL != 'quit':

    ROLL=input("What sided Die would you like to roll(You may enter quit to close)? ")
    if ROLL == 'quit':
        continue
    elif ROLL == '6':
        print(random.randint(1, 6))
    elif ROLL == '8':
        print(random.randint(1, 8))
    elif ROLL == '10':
        print(random.randint(1,10))
    elif ROLL == '12':
        print(random.randint(1, 12))
    elif ROLL == '20':
        print(random.randint(1, 20))
    else:
        print("That's not an option please choose a die...")

print("Thank you")

```

The "continue" will make the while loop start over, and thereby checking if ROLL is "quit". Since it is, it will terminate the loop and say "Thank you".
The main error in your code is that `input` returns a string and you are comparing it to integers. By example `'6'` is not equal to `6`.

Although, you could simplify your code greatly by comparing the input to a tuple of allowed value. This will be both shorter and more extendable.

```
from random import randint

while True:
    roll = input("What sided Die would you like to roll(You may enter quit to close)? ")

    if roll == 'quit':
        break
    elif roll in ('6', '8', '10', '12', '20'):
        print(randint(1, int(roll)))
    else:
        print("That's not an option please choose a die...")

print("Thank you")

```