How do I shorten this if possible?
<p>Well, here's my code</p>

<pre><code>import time

import random

Dice = input("Would you like to roll the dice?(y/n)")

if Dice == "y":

    roll = random.randint(1,6)

    print("You have rolled a", roll)

    again = input("Would you like to roll again?(y/n)")

    while again == "y":

        roll2 = random.randint(1,6)

        print("You have rolled a", roll2)

        again = input("Roll again?(y/n)")

    if again == "n":

        time.sleep(1)

        print("Goodbye")



else:

    time.sleep(1)

    print("Goodbye")
</code></pre>

<p>If you could help, that'd be great!</p>

<p>I feel like doing someones homework. But here you go, a shortened version of your code (untested).</p>

<pre><code>import time
import random

dice = input("Would you like to roll the dice?(y/n)")

while dice == "y":
    print( "You have rolled a %s" % (random.randint(1,6)))
    dice = input("would you like to roll again?(y/n)")

time.sleep(1)
print("Goodbye")
</code></pre>

python python-3.x