What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-01 00:49:01
simple mastermind programpython
import random import os def clear(): os.system("clear") # Function to print the mastermind board def print_mastermind_board(passcode, guess_codes, guess_flags): print(&q... Add solution -
Python 2021-08-31 19:30:02
types of dict comprehension
# Dictionary Comprehension Types {j:j*2 for i in range(10)} #using if {j:j*2 for j in range(10) if j%2==0} #using if and {j:j*2 for j in range(10) if j%2==0 and j%3==0} #using if else {j:(j*2 if j%2==0 and j%3==0 else 'invalid' )for j in range(10) } Add solution -
Python 2021-08-30 19:18:02
word search puzzle python
An improved (shorter, more efficient) version of the above: #!/usr/bin/python # -*- coding: utf-8 -*- puzzle='''F Y Y H N R D R L J C I N U A A W A A H R N T K L P N E C I L F S A P E O G O T P N H P O L A N D ''' clues = ['ITALY', 'HOLLAND'... Add solution -
Python 2021-08-30 14:00:02
python matrix calculation
# A basic code for matrix input from user R = int(input("Enter the number of rows:")) C = int(input("Enter the number of columns:")) # Initialize matrix matrix = [] print("Enter the entries rowwise:") # For use... Add solution -
Python 2021-08-30 03:38:02
python person name matching
import numpy as np def levenshtein_ratio_and_distance(s, t, ratio_calc = False): """ levenshtein_ratio_and_distance: Calculates levenshtein distance between two strings. If ratio_calc = True, the function computes the ... Add solution
Best helpers
Ranking is empty