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 segments(list, length): | |
""" | |
Gets every possible segment of a specific length from a list | |
[1, 2, 3, 4] | |
length = 2 | |
-> | |
[[1, 2], [2, 3], [3, 4]] | |
""" | |
all_segments = [] |
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 tkinter as tk | |
import tkinter.ttk as ttk | |
#from tkinter import LEFT, RIGHT, UP, BOTTOM | |
from tkinter import * | |
from tkinter.colorchooser import * | |
import tkinter.messagebox | |
from tkinter.filedialog import * | |
import pickle | |
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
public static void print (String to_print) { | |
System.out.println(to_print); | |
} | |
private static void input (String to_print) { | |
Scanner scanner = new Scanner (System.in); | |
System.out.print(to_print); | |
String name = scanner.next(); // Get what the user types. | |
} |
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 threading | |
import multiprocessing | |
import itertools | |
import datetime | |
import time | |
import sys | |
import os | |
import copy | |
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
#FUTURE IMPORTS GO HERE | |
# | |
# | |
def remove_char(expression, character): | |
""" | |
Returns a new string with all of a specific character removed |
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 nindex(number, idx, idx2=None): | |
if idx2 == None: | |
idx2 = idx + 1 | |
return int(str(number)[idx:idx2]) |
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 nmax(lst): | |
maxed = (int(str(lst[0])[0]), lst.index(lst[0])) | |
for number in lst[1:]: | |
if int(str(number)[0]) > maxed[0]: | |
maxed = (number, lst.index(number)) | |
return maxed |
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 itertools | |
import math | |
class Polynomial: | |
""" | |
Polynomial class | |
Magic Methods: | |
__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
import requests | |
import time | |
import sys | |
#STATIC VARIABLES | |
BITCOIN_URL = 'https://api.coinmarketcap.com/v1/ticker/bitcoin/' | |
REFRESH_SPEED = 3 | |
ROUND = 2 |
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
class String: | |
""" | |
Composite of str class made to experiment with string formatting | |
""" | |
def __init__(self, string): | |
self.string = string | |
self.new_string = string | |
def __iter__(cls): |
OlderNewer