我想编写一个掷骰子的程序。现在这就是我所拥有的:
import random
print("You rolled",random.randint(1,6))
Run Code Online (Sandbox Code Playgroud)
我也希望能够做这样的事情:
print("Do you want to roll again? Y/N")
Run Code Online (Sandbox Code Playgroud)
然后如果我按 Y 它会再次滚动,如果我按 NI 退出应用程序。提前致谢!