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
#!/usr/bin/python | |
aaa = ['4','2','5'] | |
bbb = ['4','2','5'] | |
for i in range(len(aaa)): | |
if aaa[i] == bbb[i] : | |
print "matched" | |
else: | |
print "unmatched" |
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
#!/usr/bin/python | |
# Thiss script calculate age in years, days, hours, minutes and seconds with auto update | |
# Emad Elsaid's ruby script inspired me to write this script | |
#ruby script link : https://gist.github.com/blazeeboy/9185583 | |
import time, datetime | |
date_of_birth = '1988-4-18' |
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
#!/usr/bin/python | |
#this script takes long time to get the first number that has 500 divisors | |
number = 0 | |
for i in range(1,10000): | |
number += i | |
s = 0 | |
for x in range(1,number+1): | |
if number % x == 0 : |
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
#!/usr/bin/python | |
End = 4000000 | |
Sum = 2 | |
back = 1 | |
current = 2 | |
def is_even(n): | |
return n % 2 == 0 |
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
#!/usr/bin/python | |
number = 100 | |
n = 100 | |
fact = 1 | |
while number > 0 : | |
fact *= number | |
number -= 1 |