Created
October 5, 2018 02:41
-
-
Save wuthmone/55445ed5322ce286846f8253bde2c4fd to your computer and use it in GitHub Desktop.
Generate th random number
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 requests as rq | |
import json | |
from random import randint | |
INT_MAX = 29 # Global | |
starting_point = randint(0, INT_MAX) # Get the starting number | |
array_num = ['0'] * 29 # Create list of value '0' of len 29 | |
# Make changes on required position | |
if starting_point not in [29, 28, 27, 25]: | |
array_num[starting_point] = '1' | |
array_num[starting_point+1] = '1' | |
array_num[starting_point+2] = '1' | |
array_num[starting_point+3] = '1' | |
else: | |
starting_point = 28 | |
array_num[starting_point] = '1' | |
array_num[starting_point-1] = '1' | |
array_num[starting_point-2] = '1' | |
array_num[starting_point-3] = '1' | |
print(array_num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment