Skip to content

Instantly share code, notes, and snippets.

@iNawaR1
Last active January 15, 2022 23:54
Show Gist options
  • Save iNawaR1/fe7503e1de707b21abf0308d7e2cbb40 to your computer and use it in GitHub Desktop.
Save iNawaR1/fe7503e1de707b21abf0308d7e2cbb40 to your computer and use it in GitHub Desktop.
a small and simple script that generate a random numbers from a Number List (school project)
import random
import requests
re = "\033[1;31m"
gr = "\033[1;32m"
cy = "\033[1;36m"
do = '\033[1;37m'
so = '\033[1;35m'
po = '\033[1;38m'
print(f'{re}☆:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::☆')
print(f'''
{re} \n███╗░░██╗░█████╗░░██╗░░░░░░░██╗░█████╗░██████╗{gr} \n████╗░██║██╔══██╗░██║░░██╗░░██║██╔══██╗██╔══██╗{cy} \n██╔██╗██║███████║░╚██╗████╗██╔╝███████║██████╔╝ {do} \n██║╚████║██╔══██║░░████╔═████║░██╔══██║██╔══██╗{so} \n██║░╚███║██║░░██║░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║{po} \n═╝░░╚══╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝ ''')
print(f'{re}☆:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::☆')
mylist = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]
#if you want more than 1 random number from your List just delete the 1 and type how many numbers you want to gen e.g x = random.sample(mylist,10)
#this will give you 10 random numbers from the List.
x = random.sample(mylist,1)
print('your random number is' , x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment