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 random | |
population = [] | |
#reproduction command | |
def reproduce(DNA): | |
assignname = str(random.randint(1000, 10000)) | |
organism = Organism(assignname, DNA) | |
population.append(organism) | |
#command to do a turn for the entire population | |
def TurnNow(): | |
global population |
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 random | |
population = [] | |
turncount = 0 | |
#reproduction command | |
def reproduce(DNA): | |
assignname = str(random.randint(1000, 9999)) | |
organism = Organism(assignname, DNA) | |
population.append(organism) | |
#command to do a turn for the entire population | |
def TurnNow(): |
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 random | |
population = [] | |
turncount = 0 | |
#reproduction command | |
def reproduce(DNA): | |
assignname = str(random.randint(1000, 9999)) | |
organism = Organism(assignname, DNA) | |
population.append(organism) | |
#command to do a turn for the entire population | |
def TurnNow(): |
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
<?php | |
$files = scandir('documents'); | |
for ($i = 0; $i<count($files); $i++) { | |
echo '<div class="document"><a href="documents/' . $files[$i] . '">'. str_replace('.docx', '', $files[$i]) . '</a></div>'; | |
} | |
?> |
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
'o\x83\x84\x8e \x8e\x90\x8b\x80\x8d \x8f\x8a\x8b \x8e\x80~\x8d\x80\x8f \x88\x80\x8e\x8e|\x82\x80 \x84\x8e \x8e\x87\x84\x82\x83\x8f\x87\x94 \x88\x8a\x8d\x80 \x91\x84\x8f|\x87 \x8f\x8a \x8f\x83\x80 ~|\x90\x8e\x80 \x8f\x83|\x89 \x94\x8a\x90\x8d \x8b\x8d\x80\x91\x84\x8a\x90\x8e \x8a\x89\x80I d\x8f \x88|\x94 ~\x8a\x89\x8f|\x84\x89 ~\x8a\x89\x8f\x80\x89\x8f \x8f\x83|\x8f \x84\x8e \x89\x8a\x8f \x81\x8a\x8d \x91\x84\x80\x92\x80\x8d\x8e |\x8f \x8f\x83\x80 \x81|\x84\x89\x8f \x8a\x81 \x83\x80|\x8d\x8fI' |
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
final = "" | |
text = raw_input("Enter text: ") | |
for c in text: | |
if c == ' ': | |
final += c | |
else: | |
convert = ord(c) | |
convert -= 27 | |
letter = chr(convert) | |
final += letter |
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
final = "" | |
text = raw_input("Enter text: ") | |
for i in xrange(len(text)): | |
if i % 2 != 0: | |
letter = text[i-1:i] | |
final += letter | |
print final |
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 random | |
string = " " | |
times = input("Enter amount of characters: ") | |
for i in xrange(times): | |
num = random.randint(97,122) | |
character = chr(num) | |
string += character | |
print string |
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
output = [] | |
f = open('lines.txt', 'r') | |
li = f.readlines() | |
f.close() | |
for i in li: | |
output.insert(0, i) | |
out = open('output.txt', 'w') | |
for item in output: | |
print item | |
out.write(item) |
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
x = [0,1] | |
y = 0 | |
total = 0 | |
while y < 4000000: | |
y = x[-2] + x[-1] | |
x.append(y) | |
for i in x: | |
if i % 2 == 0: | |
total += i |
OlderNewer