What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-29 09:11:09
naive bayes classifier calculating sigma
# Naive Bayes On The Iris Dataset from csv import reader from random import seed from random import randrange from math import sqrt from math import exp from math import pi # Load a CSV file def load_csv(filename): dataset = list() with open(filename, ... Add solution -
Python 2021-10-23 07:37:13
python snakes and ladders
#Heres a snakes and ladders game I made, felt the need to share it so others could play it too import tkinter as tk from time import sleep from random import randint root = tk.Tk() Grid = [] for i in range(8): GridRow = [] for j in range(8): Gr... 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-09 11:15:04
how to count the number of guesses in python
from random import randint guesses = 0 randomNum = (randint(0,100)) numPlayer = 0 while (numPlayer!=randomNum): numPlayer = int(input("Guess the number(0-100)")) if (numPlayer>randomNum) : print "It's -" elif ... Add solution
Best helpers
Ranking is empty