while True:
    continuar = input("Deseja continuar? ")
    if continuar != 'S' and continuar != 's':
        break
print("Encerrou")

#https://pt.stackoverflow.com/q/421327/101