What do you want to save?
Add Code snippet
New code examples
-
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-11 13:17:12
string representation of object python
#!/bin/python3 import math import os import random import re import sys class Car: def _init_(self,speed,unit): self.speed=speed self.unit=unit def __str__(self): return "Car with the maximum speed of {} {}".for... Add solution -
-
Python 2021-11-08 03:32:16
basic python hangman game
import random, time fruits = ['pear', 'mango', 'apple', 'banana', 'apricot', 'pineapple','cantaloupe', 'grapefruit','jackfruit','papaya'] superHeroes = ['hawkeye', 'robin', 'Galactus', 'thor', 'mystique', 'superman', 'deadpool', 'vision', 'sandman', 'aqua... Add solution -
Python 2021-11-08 03:30:07
select a value randomly in a set python
import random # with replacement = same item CAN be chosen more than once. # without replacement = same item CANNOT be chosen more then once. # Randomly select 2 elements from set without replacement and return a list random.sample(set_name, 2) Add solution
Best helpers
Ranking is empty