What do you want to save?
Add Code snippet
New code examples
-
Python 2021-08-31 09:16:02
python for loop start, end
def main(): #defines the area in indents that will be triggered with main()# print('hi') yn = input('Wanna loop back to the start? ') if yn = 'yes': main() #loops back to where we defined main# main() #This starts the main loop, without thi... Add solution -
Shell/Bash 2021-08-30 03:08:02
bash print keys of awk array
# Example usage for printing keys: awk '{ a[$1]=$2 } END { for (key in a) { print key } }' input_file # Where: # - The above statement prints all keys in the awk array/dictionary # made from the input_file # - a[$1] is an array/dictionary in which the fi... Add solution -
Javascript 2021-08-29 21:37:02
Sum All Primes
// I will update this code later, cause this is already very tasky, // bad performance(Two loops inside a loop) // Very bad, but it works const sumPrimes = num => { const divisor = [] for(let i = 2; i <= num; i++){ let factorial = [], j = ... Add solution -
Shell/Bash 2021-08-28 14:09:02
awk: can't read value of a; it's an array name.
# Example usage for printing keys: awk '{ a[$1]=$2 } END { for (key in a) { print key } }' input_file # Where: # - The above statement prints all keys in the awk array/dictionary # made from the input_file # - a[$1] is an array/dictionary in which the fi... Add solution -
Java 2021-08-28 09:21:01
java nth fibonacci number
// Using following formula you can find nth Fibonacci Number without using any loops; // Created by using resources from " https://math.hmc.edu/funfacts/fibonacci-number-formula/ " class Find { public int nFibo(int n) { double P... Add solution -
Python 2021-08-27 23:00:02
python nested loop for a 2D list
list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] for i in range(0, len(list)): # loops over the external list for j in range(0, len(list[i])): # loops over every internal list print(list[i][j], end="\t") # prints the elements of the inner l... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5