from tkinter import *
import tkinter.messagebox as tmsg

root = Tk()
root.geometry("455x233")
root.title("Slider Tutorial")

def getdollar():
    print(f"We have credited {myslider2.get()} dollars to your bank account")
    tmsg.showinfo("Amount Credited!", f"We have credited {myslider2.get()} dollars to your bank account")


Label(root, text = "How many dollars you want?").pack()

myslider2 = Scale(root, from_ = 0, to = 100, orient = HORIZONTAL, tickinterval = 50)
myslider2.set(34)
myslider2.pack()
Button(root, text = "Get dollars!", pady = 10, command = getdollar).pack()

root.mainloop()