What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-07 11:12:01
python loop backwards
for i in range(len(item)-1, -1, -1): print(item[i]) Add solution -
TypeScript 2021-09-07 04:53:02
Describe a dynamic programming algorithm to determine the minimum number of coins to make c cents with coin denominations v1; v2; : : : vk.
INF = 100000 def min(x, y): if x < y: return x return y #k is number of denominations of the coin or length of d def coin_change(d, n, k): M = [0]*(n+1) for j in range(1, n+1): minimum = INF for i in range(1, k+1): if(j &g... Add solution -
Other 2021-09-06 22:58:03
plotly heatmap hovertemplate vs hover text
import plotly import random plotly.offline.init_notebook_mode() colorscale = [[0, '#454D59'],[0.5, '#FFFFFF'], [1, '#F1C40F']] x = [2015, 2016, 2017] y = ['March', 'February', 'January', 'December', 'November', 'October', 'September', 'August', 'July', ... Add solution -
Python 2021-09-06 17:03:03
coding shiksha python pyautogui keep your pc alive
# Import required modules import pyautogui import time # FAILSAFE to FALSE feature is enabled by default # so that you can easily stop execution of # your pyautogui program by manually moving the # mouse to the upper left corner of the screen. # O... Add solution -
Python 2021-09-06 12:56:01
smallest program to make diamond python
h = eval(input("please enter diamond's height:")) for i in range(h): print(" "*(h-i), "*"*(i*2+1)) for i in range(h-2, -1, -1): print(" "*(h-i), "*"*(i*2+1)) # please enter diamond's height:4 # ... Add solution -
Python 2021-09-06 04:28:02
quick way to find the factor of a number python
def factors(x): listOfFactors = [] for i in range(1, int(x ** 0.5)): # Use a loop from 1 to the square root of x for more speed. if x % i == 0: listOfFactors.append(x) listOfFactors.append(i) # May repeat some numbers. Furth... Add solution
Best helpers
Ranking is empty