This file contains hidden or 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 menu_selection(): | |
| try: | |
| print("Menu:") | |
| choice = str(input("add(a), remove(r), find(f):" )).lower | |
| except ValueError: | |
| print("please follow the directions above") | |
| return choice | |
| def execute_selection(choice, a_dict): | |
| if choice == "a": |
This file contains hidden or 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 get_word_string(user_file): | |
| user_file = open(user_file,"r") | |
| states = [] | |
| #wordString = '' # start with an empty string of words | |
| lines = user_file.readlines() | |
| header = lines[0].split(",") | |
| for line in lines[0:]: | |
| items = line.split("\n") | |
| states.append(items) | |
| #print(states) |
This file contains hidden or 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 get_word_string(user_file): | |
| user_file = open(user_file,"r") | |
| states = {} | |
| #wordString = '' # start with an empty string of words | |
| lines = user_file.readlines() | |
| header = lines[0].split(",") | |
| for line in lines[1:]: | |
| items = line.split(",") | |
| states[items[0]] = dict(zip(header[1:], items[1:]))) | |
This file contains hidden or 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 fractions import Fraction | |
| # shares price | |
| def sharesXprice(stock,valiue): | |
| result = stock*valiue | |
| divide = valiue % 1 | |
| dollar = int(valiue) | |
| print("{0} shares with market price {1} {2} have valiue ${3}".format(shares,dollar,divide,result)) |
This file contains hidden or 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 fractions import Fraction | |
| def integer(first): | |
| try: | |
| i = int(first) | |
| except: | |
| return False | |
| return True |
This file contains hidden or 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
| start = int(input("Input a position between 1 and 10:")) | |
| position = start | |
| if start > 10 or start < 1: | |
| exit() | |
| print("l - for moving left") | |
| print("r - for moving right") | |
| print("Any other letter for quitting") | |
| while True: | |
| move = input("Input your choice:") | |
| if move not in "lr": |
This file contains hidden or 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
| #!/bin/bash | |
| if [ "$#" -eq 0 ] | |
| then | |
| ls | sort | run-parts ${BASH_SOURCE[0]} | |
| fi | |
| if [ $1 ! 1 ] | |
| then |
This file contains hidden or 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 random import shuffle, choice, randint | |
| key = {} | |
| key['a'] = 11.68 | |
| key['b'] = 4.43 | |
| key['c'] = 5.24 | |
| key['d'] = 3.17 | |
| key['e'] = 2.80 | |
| key['f'] = 4.03 |
This file contains hidden or 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
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCV+A4IbJdxJmM9kLPo/RD+5OsU3W+Uapmbb1cZt2EqQY1jWlaCx/dwmHv68lg8IZkr5bUvz0ivPviY5xCvKUI6C44acUkr5rxUlRxIJ/Ig4YO6RCxZwSiW1ohMR7hf1KYqoH6xhbSn8fDhx88R6u0eLquWrGDGGHOX0lJW6AHyu12HVfdEuxLJ+9H3K/1MHQt1bq/UunxfpFDogowvJc6w7qoDy5Vum4qpADrCFpIn1SWqkOYuwBcq8MceNDxjhVyZezJHf9bWGgc8/S7fWtjpybrJw5f8CWlx3zdki5X42YP8tS73KdSEU0K5zLKhD5+HhdzYDuTpJQOKXxGci7a7 arnisig@mentiscura.is |
This file contains hidden or 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 datetime | |
| def percentage_of_first_trump_term_remaining(): | |
| return (datetime.datetime.now() - datetime.datetime(year=2017, month=1, day=20))/(datetime.datetime(year=2021, month=1, day=20) - datetime.datetime(year=2017, month=1, day=20)) |