What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-11-20 11:25:14
Shuffle a given array of elements (Fisher–Yates shuffle)
from random import randrange # Utility function to swap elements `A[i]` and `A[j]` in a list def swap(A, i, j): temp = A[i] A[i] = A[j] A[j] = temp # Function to shuffle a list `A` def shuffle(A): # read list from the lowest in... Add solution -
Python 2021-11-11 23:48:22
modules in python
#use import statement to import modules import random r = random.randint(1,10) #use from-import statements to import functions from random import randint r = randint(1,10) #use from module import * statement to import all functions from random import * r ... Add solution -
Python 2021-11-09 05:39:10
return code error python
from turtle import* from random import randrange from freegames import square, vector food = vector(0,0) snake = [vector(10,0)] aim = vector(0,-10) def change(x,y): aim.x=x aim.y=y def inside(head): return -200<head.x<190 and -200 <head... Add solution -
Python 2021-11-03 21:30:13
roll dice python
from random import randint def roll_dice(): print(f"Number is: {randint(1,6)}") # Do this to simulate once roll_dice() # Do this to simulate multiple times whatever = 12 # Put the number of times you want to simulate here for number in... Add solution
Best helpers
Ranking is empty