• Apr 21, 2023 •sebastianagauyao2002-61a8
0 likes • 3 views
print("hellur")
• Oct 4, 2023 •AustinLeath
0 likes • 10 views
weigh = lambda a,b: sum(b)-sum(a) FindCoin = lambda A: 0 if (n := len(A)) == 1 else (m := n//3) * (w := 1 + weigh(A[:m], A[2*m:])) + FindCoin(A[m*w:m*(w+1)]) print(FindCoin([1,1,1,1,1,1,1,2,1]))
• Nov 19, 2022 •CodeCatch
0 likes • 4 views
list_1 = [1,2,3,4,5,6,7,8,9] cubed = map(lambda x: pow(x,3), list_1) print(list(cubed)) #Results #[1, 8, 27, 64, 125, 216, 343, 512, 729]
0 likes • 0 views
# Python program for implementation of Selection # Sort import sys A = [64, 25, 12, 22, 11] # Traverse through all array elements for i in range(len(A)): # Find the minimum element in remaining # unsorted array min_idx = i for j in range(i+1, len(A)): if A[min_idx] > A[j]: min_idx = j # Swap the found minimum element with # the first element A[i], A[min_idx] = A[min_idx], A[i] # Driver code to test above print ("Sorted array") for i in range(len(A)): print("%d" %A[i]),
• Jan 23, 2021 •asnark
0 likes • 1 view
""" Take screenshots at x interval - make a movie of doings on a computer. """ import time from datetime import datetime import ffmpeg import pyautogui while True: epoch_time = int(time.time()) today = datetime.now().strftime("%Y_%m_%d") filename = str(epoch_time) + ".png" print("taking screenshot: {0}".format(filename)) myScreenshot = pyautogui.screenshot() myScreenshot.save(today + "/" + filename) time.sleep(5) # # and then tie it together with: https://github.com/kkroening/ffmpeg-python/blob/master/examples/README.md#assemble-video-from-sequence-of-frames # """ import ffmpeg ( ffmpeg .input('./2021_01_22/*.png', pattern_type='glob', framerate=25) .filter('deflicker', mode='pm', size=10) .filter('scale', size='hd1080', force_original_aspect_ratio='increase') .output('movie.mp4', crf=20, preset='slower', movflags='faststart', pix_fmt='yuv420p') .run() ) """
from math import pi def rads_to_degrees(rad): return (rad * 180.0) / pi rads_to_degrees(pi / 2) # 90.0