Python Forum

Full Version: Can't get defined random integer to print properly?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
https://imgur.com/a/TAarvQQ

^I've attached the image above, program when it runs is on the left. Any help would be appreciated Smile
import random

print("Welcome!")


def diceroll():
    return random.randint(1, 6)


print(diceroll())
Now this works. You did not return anything.