Generate random numbers in Python

10 Views
Published
#python #tutorial #course

Python random module tutorial example explained

00:00:00 random module
00:04:32 number guessing game

import random

low = 1
high = 20
options = ['Rock', 'Paper', ‘Scissors’]
cards = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']

#number = random.random()
#number = random.randint(1, 6)
#number = random.randint(low, high)
#choice = random.choice(options)
#random.shuffle(cards)
Category
Bro Code
Tags
python tutorial for beginners, python course
Be the first to comment