I hereby claim:
- I am hwatwasthat on github.
- I am hwatwasthat (https://keybase.io/hwatwasthat) on keybase.
- I have a public key ASBumR85A8o2i5LqKQcOXGCCU0uvMmkRMCGzP_rgZKRxKQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def divisors(Num): | |
#Ensure number is positive | |
if Num <= 0: | |
print("Number must be positive") | |
main() | |
#create range to work in | |
range_nums = range(1, Num) | |
#create list for all divisors |
import random | |
# function to generate required fibonacci sequence | |
def fibonacci(k): | |
# intiate counter | |
i = 1 | |
# intiate list to iterate on | |
main_list = [0, 1] |
word = input("In:") | |
sumof = 0 | |
x = 0 | |
for i in word: | |
if word[x] == "a" or word[x] == "e" or word[x] == "i" or word[x] == "o" or word[x] == "u": | |
sumof += 1 | |
x += 1 | |
print(sumof) |
import random, time | |
k = 0 | |
def sorted_list(a, b): | |
test = random.sample(range(a), b) | |
test.sort() | |
return test | |
def binary_search(sorter, num_find): | |
print (sorter) |
import string, random | |
from collections import OrderedDict | |
from itertools import count | |
# creating numerically linked dictionaries to pull characters from | |
lower = OrderedDict(zip(count(1), string.ascii_lowercase)) | |
upper = OrderedDict(zip(count(27), string.ascii_uppercase)) | |
symbols = OrderedDict(zip(count(53), (string.punctuation))) | |
length = int(input("How many characters would you like in your password?")) | |
i = 0 |
import random | |
list = [] | |
i = 0 | |
while i < 100: | |
list.append(random.randrange(1,40)) | |
i += 1 | |
# creating a list with no duplicates using a for loop | |
def list_no_duplicates(list): | |
# sorting list to make it pretty |
# Values entered must be hex encoded, preface with 0x if not already | |
def hex_xor(first, second): | |
result = (first ^ second) | |
return result |
import base64 | |
def hex_to_base64(input): | |
result = bytearray.fromhex(input) | |
result = base64.b64encode(result) | |
result = str(result).strip("'b'") | |
return result |
# Input from console for word to check | |
word = input("What would you like to check if its a Palindrome?") | |
#initialise variables | |
x = 0 | |
reverse_word = '' | |
# loop over word until all letters are done | |
for i in word: | |
# increment counter | |
x += 1 | |
# extend reverse_word with next letter from word (reversed) |