What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-03 21:09:05
show multiple matplotlib images
import numpy as np import matplotlib.pyplot as plt w = 10 h = 10 fig = plt.figure(figsize=(8, 8)) columns = 4 rows = 5 for i in range(1, columns*rows +1): img = np.random.randint(10, size=(h,w)) fig.add_subplot(rows, columns, i) plt.imshow(im... Add solution -
Python 2021-10-03 06:37:02
how to make a set of math questions in python
import random from datetime import datetime import time random.seed(time.time()) answerlist=[] for i in range(1,26): sw = False f = random.randint(1,99) w = random.randint(1,99) if f >= 10 and w >= 10: sw = True while sw == False: ... Add solution -
Python 2021-10-01 11:54:02
guessing game in python
# updated version import random # for instructions so that the user understands def instructions(): print("Welcome to the guessing game you will have 3 tries to pick a number 1-10") print("Good luck btw it's all random") inst... Add solution -
Python 2021-10-01 04:27:02
python pygame tutorial coderslegacy
#Setting up FPS FPS = 60 FramePerSec = pygame.time.Clock() #Creating colors BLUE = (0, 0, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLACK = (0, 0, 0) WHITE = (255, 255, 255) #Other Variables for use in the program SCREEN_... Add solution -
Python 2021-09-27 04:29:03
stress test maximum pairwise product in python
#Uses python3 'trying to work with stress testing' __author__ = 'InnerPeace' import random import argparse #naive solution def maxpairwiseproduct(n, a): assert len(a) == n, "the length of the list is not equal to n = %r" % n assert n ... Add solution -
Python 2021-09-26 14:49:04
np.random.randint to generate -1 +1
2 * np.random.randint(2, size=10) -1 Add solution
Best helpers
Ranking is empty