What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-18 00:32:06
tic tac toe algorithm python
#Tic Tac Toe game in python by techwithtim board = [' ' for x in range(10)] def insertLetter(letter, pos): board[pos] = letter def spaceIsFree(pos): return board[pos] == ' ' def printBoard(board): print(' | |') print(' ' + board[1]... Add solution -
SQL 2021-10-17 12:46:07
populate sql table with random data
>>> import random >>> random.randrange(0, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/mj/Development/Libraries/buildout.python/parts/opt/lib/python2.7/random.py&qu... Add solution -
Python 2021-10-14 19:41:07
standard import packages
# Import Packages # Array and Dataframe processing: import pandas as pd import numpy as np # Visualization: import seaborn as sns sns.set_style("darkgrid") import matplotlib.pyplot as plt %matplotlib inline import plotly.graph_objects as go im... Add solution -
Python 2021-10-13 23:01:05
python json random number generator
import json from faker import Faker import random from random import randint fake = Faker('en_US') for _ in range(10): my_dict = { 'foo': randint(0, 100), 'bar': {'baz': fake.name(), 'poo': float(random.randrange(155, 389))/100 } } ... Add solution -
Python 2021-10-12 02:28:05
python shuffle two lists in the same way
# Example usage using random: import random # Say you want to shuffle (randomly reorder) the following lists in the # same way (e.g. because there's an association between the elements that # you want to maintain): your_list_1 = ['the', 'original', 'order... Add solution
Best helpers
Ranking is empty