Skip to content

Instantly share code, notes, and snippets.

View lohxx's full-sized avatar

Lohanna lohxx

View GitHub Profile
def swap(min,max,arr):
arr[max],arr[min] = arr[min],arr[max]
return arr[max]
def bubble_sort(arr):
for i in range(len(arr)):
for j in range(len(arr)-1):
if arr[j] > arr[j+1]:
swap(j,j+1,arr)
print(arr)
@lohxx
lohxx / sub_list.py
Last active February 26, 2018 22:50
def sub_list(sub,lst):
comprehession = [x for x in sub for m in lst if x == m]
return True if len(sub) == len(comprehession) else False
print(sub_list([1, 2, 3],[1, 2, 3, 4, 5]))
'''
Sublist
Given two lists determine if the first list is contained within the second list, if the second list is contained within the first list, if both lists are contained within each other or if none of these are true.
def ArmstrongNumbers(number):
return True if sum([int(x) ** len(str(number)) for x in str(number)]) == number else False
def bracketPush(comb):
combine = ''
for i in comb.split():
combine += i
print(combine)
print(comb.replace(" ",""))
if combine == comb.replace(" ",""):
return True
else:
return False
const max = arr => arr.sort((a,b)=>b-a).shift();
const min = arr => arr.sort().shift();
@lohxx
lohxx / init.py
Last active March 1, 2019 20:32
Migrador de playlist
# spotify
import click
import flask
class Song:
def __init__(self, name, artist):
self.name = name
self.artist = artist
@lohxx
lohxx / cargo.toml
Last active September 12, 2021 03:26
Port do scraper de classificações do brasileirão para rust
[package]
name = "brasileirao-rust-port"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
reqwest = { version = "0.11", features = ["blocking", "json"] }
scraper = "0.12.0"
Processo
07150165020228020001
80668354420228050001
07179201420208020001
00315093220118020001
00013365820115020071
10001890920215020433
08065777420194058000
07271152320208020001
50202022120188210001