What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-27 17:39:03
Find duplicate rows in a 5x5 Matrix.
# A class representing a node: class Trie: # Constructor def __init__(self): self.character = [None] * 2 &nbs... Add solution -
Python 2021-09-24 15:12:02
list() python
#Creating lists my_list = ['foo', 4, 5, 'bar', 0.4] my_nested_list = ['foobar', ['baz', 'qux'], [0]] #Accessing list values my_list[2] # 5 my_list[-1] # 0.4 my_list[:2] # ['foo', 4, 5] my_nested_list[2] # ['baz', 'quz'] my_nested_list[-1] # [0] my_nested... Add solution -
Python 2021-09-23 08:35:07
complete python developer in 2020 zero to mastery
# Note: No semicolons needed. Comments: # # Tips: \n in string adds new line. \t adds new tab. len() measures length of item. int(), str(), float(), bool, etc converts items # Output: print(value) print("Hi!") # Variables my_variable = "Hi!... Add solution -
Other 2021-09-18 04:21:04
gdscript loop through array
# loop for n = 0 to 7 for n in 8: print(n) # Using range for n in range(8): print(n) # loop for n = 10 to 12 for n in range(10,13): print(n) # count down from 10 to 1 for n in range(10,0,-1): print(n) # loop for n = 2,4,6,8 in steps of... Add solution -
Javascript 2021-09-17 15:37:05
python functions list
list.append(x) # append x to end of list list.extend(iterable) # append all elements of iterable to list list.insert(i, x) # insert x at index i list.remove(x) # remove first occurance of x from list list.pop([i]) # pop element at index i (defaults to end... Add solution -
Python 2021-09-15 17:38:02
python ists
my_list = ["banana", "cherry", "apple"] # len() : get the number of elements in a list print("Length:", len(my_list)) # append() : adds an element to the end of the list my_list.append("orange") # inser... Add solution -
Python 2021-09-12 04:13:03
python time function duration and memory usage
import time import resource time_start = time.perf_counter() # insert code here ... time_elapsed = (time.perf_counter() - time_start) memMb=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss/1024.0/1024.0 print ("%5.1f secs %5.1f MByte" % (tim... Add solution