What do you want to save?
Add Code snippet
New code examples
-
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 -
TypeScript 2021-11-03 15:35:15
generate random numbers in python within a range
import random # generates completely random number x = random.random() # generates a random int x = random.randint() # generates a random int in a range x = random.randint(1, 100) # NOTE: RANGE DOESN'T WORK FOR random.random() Add solution -
Python 2021-11-01 18:54:15
pygame rect follower
import pygame import random import math # --- constants --- (UPPER_CASE_NAMES) SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 FPS = 25 # for more than 220 it has no time to update screen BLACK = (0, 0, 0) WHITE = (255, 255, 255) # --- classes --- (CamelCaseN... Add solution
Best helpers
Ranking is empty