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
__AUTHOR__ = 'KARL HERBINE' | |
AA = {'LYS':'K', 'ALA':'A', 'ARG':'R', 'ASN':'N', 'ASP':'D','CYS':'C','GLU':'E', 'GLY':'G','HIS':'H', 'ILE':'I','LEU':'L','MET':'M', 'PHE':'F', 'PRO':'P', 'SER':'S', 'THR':'T', 'TRP':'W', 'TYR':'Y','VAL':'V','GLN':'Q'} | |
CHAINS = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') | |
print 'Amino Acid Sequence differences'.center(100,' ') | |
print 'This Python script is useful for comparing AA sequences between two polypeptides (eg. Mutant vs Wild-Type)' | |
print 'NOTE: SOME HOMOLOGOUS STRUCTURES MAY NOT CONTAIN SAME NUMBER OF RESIDUES'.center(100,' ') | |
pdb1 = str(raw_input("Enter the name of the first pdb file (name.pdb): ")) | |
pdb2 = str(raw_input("Enter the name of the second pdb file (name.pdb): ")) |
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 random | |
from random import randint | |
print "Welcome to guess a number 2.0 - This time I will try to guess a number that YOU pick in a range (0 - number)" | |
number = int(raw_input("What range would you like? (0 - ?) ")) | |
def guess_game(number): | |
guess = randint(0,number) | |
new_list = [i for i in range(0,number+1)] | |
validate = raw_input("Is your number %d? (y/n) " % guess) | |
turn = 1 | |
while validate == 'n': |
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
print "Enter '3' numbers to return the maximum of all three!" | |
one = int(raw_input("Enter your 'first' number: ")) | |
two = int(raw_input("Enter your 'second' number: ")) | |
three = int(raw_input("Enter your 'third' number: ")) | |
max_of_3 = [] | |
max_of_3.append(one), max_of_3.append(two), max_of_3.append(three) | |
max_of_3.sort() | |
print "The max number is:" ,max_of_3[2] |
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 random | |
from random import randint | |
print "Welcome to guess a number 2.0 - This time I will try to guess a number that YOU pick in a range (0-100)" | |
def guess_game(): | |
guess = randint(0,100) | |
new_list = [i for i in range(0,101)] | |
validate = raw_input("Is your number %d? (y/n)" % guess) | |
turn = 1 | |
while validate == 'n': |
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
"""Gameboard Generator""" | |
columns = int(raw_input("How many columns do you want on your gameboard? ")) | |
rows = int(raw_input("How many rows do you want on your gameboard? ")) | |
def gameboard(columns,rows): | |
column = [] | |
height = [] | |
for i in range(columns): | |
column.append("| |") | |
for i in range(columns): |
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
prime = "prime.txt" | |
happy = "happy.txt" | |
pin = open(prime,'r') | |
pnumber = [p.strip() for p in pin.readlines()] | |
pin.close() | |
hin = open(happy, 'r') | |
hnumber = [h.strip() for h in hin.readlines()] | |
hin.close() | |
overlap = [] | |
for p in pnumber: |
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 random | |
lst = [i for i in range(random.randrange(0,1000))] | |
n = int(raw_input("Enter a number to see if it's in the list range: ")) | |
def elementsearch(lst,n): | |
if n in lst: | |
return True | |
else: | |
return False | |
if elementsearch(lst,n) == True: | |
print "%d is in the list range" % n |
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 random | |
from sys import exit | |
x = str(random.randint(1000,9999)) | |
def cows_and_bulls(): | |
user = raw_input("What is your guess? ") | |
Bulls,Cows,guess = 0,0,1 | |
while user != x: | |
guess += 1 | |
for i in range(len(user)): |
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 random | |
def pwgenerator(): | |
lower = 'abcdefghijklmnopqrstuvwxyz' | |
up = lower.upper() | |
special = "~!@#$%^&*()_-+=}{|[]\?/:;'<>,." | |
password = "" | |
for i in range(3): | |
password += random.choice(lower) | |
password += random.choice(up) | |
password += random.choice(special) |
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
x = str(raw_input("Type a sentence and I will reverse the order of it! ")) | |
def reverse(x): | |
x = x.split(" ") | |
for i in x: | |
f = x[::-1] | |
f = " ".join(f) | |
return f | |
print reverse(x) |
NewerOlder