Skip to content

Instantly share code, notes, and snippets.

View AbbadonAA's full-sized avatar

Anton Pushkarev AbbadonAA

View GitHub Profile
@AbbadonAA
AbbadonAA / rgb.py
Created September 26, 2021 22:36
Pass decimal to hexadecimal RGB representation
def rgb(r, g, b):
dictionary = {0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
@AbbadonAA
AbbadonAA / decoder.py
Created September 26, 2021 00:11
Finds symbols ('WUB' in case) in text and replaces it with spaces
def song_decoder(song):
return ' '.join(song.replace('WUB', ' ').split())
@AbbadonAA
AbbadonAA / Sp1_Track.py
Created September 25, 2021 15:44
Tracker from Sprint 1
import datetime as dt
FORMAT = '%H:%M:%S'
WEIGHT = 75 # Вес.
HEIGHT = 175 # Рост.
K_1 = 0.035 # Коэффициент для подсчета калорий.
K_2 = 0.029 # Коэффициент для подсчета калорий.
STEP_M = 0.65 # Длина шага в метрах.
storage_data = {}
@AbbadonAA
AbbadonAA / divisors.py
Last active September 25, 2021 15:39
Form a list of number's divisors
def divisors(integer):
divs = []
if integer > 1:
[divs.append(i) for i in range(2, integer) if integer % i == 0]
if not divs:
return f'{integer} is prime'
else:
return divs
@AbbadonAA
AbbadonAA / pangram_eng.py
Last active September 25, 2021 15:40
Get letters from str and analize pangram
def is_pangram(s):
let = []
[let.append(l.lower()) for l in s if l.isalpha()]
return True if len(set(let)) == 26 else False