Python random numbers

74 Views
Published
Python random numbers module tutorial explained

#python #random #numbers

import random

x = random.randint(1,6)
y = random.random()

myList = ['rock','paper','scissors']
z = random.choice(myList)

cards = [1,2,3,4,5,6,7,8,9,"J","Q","K","A"]

random.shuffle(cards)

print(cards)

––––––––––––––––––––––––––––––
Up In My Jam (All Of A Sudden) by - Kubbi https://soundcloud.com/kubbi
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
Free Download / Stream: http://bit.ly/2JnDfCE
Music promoted by Audio Library https://youtu.be/tDexBj46oNI
––––––––––––––––––––––––––––––
Category
Bro Code
Tags
python random, random module, python random module
Be the first to comment