Created
April 30, 2019 20:24
-
-
Save berensn/ce8fd83cb4e4d05e5c4174bde273625e to your computer and use it in GitHub Desktop.
CSV Maker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import random | |
with open ('rando_numero.csv', 'w', newline = '') as csvfile: | |
fw = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_ALL) | |
for i in range(13): | |
csv_list = [] | |
for j in range(15): | |
rando_selecto = random.randint(1, 10) | |
if rando_selecto == 1: | |
pre = random.randint(1, 999) | |
else: | |
pre = random.randint(1,99) | |
suf = random.randint(1, 99) | |
if suf < 10: | |
suf = f'0{suf}' | |
csv_list.append(f'{pre},{suf}') | |
fw.writerow(csv_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment