This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def findMulti(num: int) -> tuple: | |
limit = int(num ** 0.5) + 1 | |
for a in range(1, limit): | |
if num % a == 0: | |
b = num // a | |
if not 1 in (a, b): | |
return a, b | |
return False | |
print(findMulti(8616460799)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyModeS as pm | |
import matplotlib.pyplot as plt | |
fig, ax = plt.subplots() | |
def openFile(filename: str="log.txt") -> list: | |
_f = open("log.txt", "r") | |
_ls = [] | |
for _i in _f.readlines(): | |
_ls.append(_i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import radians, sin, cos, tan, sqrt, atan2 | |
RADIUS = 6356.752 | |
class Coordinate(): | |
def __init__(self, point_a: float, point_b: float): | |
self.a = point_a | |
self.b = point_b | |
def __repr__(self) -> str: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pytube import YouTube, Playlist | |
import os | |
from datetime import timedelta | |
def download_audio(video_url, output_path='music'): | |
yt = YouTube(video_url) | |
audio_stream = yt.streams.filter(only_audio=True, file_extension='mp4').first() | |
os.makedirs(output_path, exist_ok=True) | |
audio_stream.download(output_path) | |
print("Download complete!") |