What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-04 11:39:01
how to make a dice program in python
import random run = 1 level = 0 while(run == 1): print("**ROUND " + str(level) + "**") print("player 1: ",random.randint(0, 6)) print("player 2: ",random.randint(0, 6)) run = int(inp... Add solution -
Python 2021-09-03 23:16:02
atm python program
# ATM Processes while True: # Reading id from user id = int(input("\nEnter account pin: ")) # ... Add solution -
Other 2021-09-03 20:49:01
Generate 10 verification codes of length 4 and print them, e.g.,
#random package to find random integer import random #This method returns a random value of given length #len - parameter determines the length of the random value def random_value(len): result = '' #len decrements with each iteration #Hence... Add solution -
Python 2021-09-03 13:30:01
python roll dice 100 times graph results
import numpy as np import random import matplotlib.pyplot as plt def die_roll(rollnum, maxdots=6, ausgabe=""): all_rolls = np.random.randint(1, maxdots+1, size=rollnum) if "T" in ausgabe.upper(): i = 1 ... Add solution -
Python 2021-09-01 06:38:03
python lottery simulation
import random correct = 0 total = 0 run = 1 howmany = int(input("How many correct guesses should there be? (0-6) ")) if howmany < 0: print("That was below 0.") quit() elif howmany > 6: print("That was over 6.&... Add solution -
Python 2021-08-30 02:01:02
plotly table cell color based on values
import plotly.graph_objects as go from plotly.colors import n_colors import numpy as np np.random.seed(1) colors = n_colors('rgb(255, 200, 200)', 'rgb(200, 0, 0)', 9, colortype='rgb') a = np.random.randint(low=0, high=9, size=10) b = np.random.randint(lo... Add solution -
Python 2021-08-29 14:42:01
np array append
x = np.random.randint(2, size=10) x = np.append(x, 2) Add solution
Best helpers
Ranking is empty