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
i=0 | |
while read x | |
do | |
arr[$i]=$x | |
i=$i+1 | |
done | |
echo ${arr[@]} |
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
read input | |
printf "%.3f\n" `echo "$input" | bc -l` |
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
read x | |
read y | |
read z | |
if [ $x -eq $y -a $x -eq $z ] | |
then | |
echo "EQUILATERAL" | |
elif [ $x -ne $y -a $x -ne $z -a $y -ne $z ] | |
then | |
echo "SCALENE" | |
else |
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
words = [] | |
def evenPal(word): | |
steps = 0 | |
l = len(word) | |
w1 = word[:l/2] | |
w2 = word[l/2:] | |
w2 = w2[::-1] | |
for i in xrange(0, len(w1)): | |
steps += abs(ord(w1[i]) - ord(w2[i])) |
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
people = [] | |
for _ in range(int(raw_input())): | |
people.append(int(raw_input())) | |
for n in people: | |
print ((n*(n-1))/2) |
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
pairs = [] | |
for _ in xrange(int(raw_input())): | |
pairs.append(int(raw_input())) | |
for item in pairs: | |
print item+1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from google.appengine.api import urlfetch | |
result = urlfetch.fetch("http://software.sopili.net/") | |
result.content |
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
#Python 2 | |
python -m SimpleHTTPServer 8080 | |
#Python 3 | |
python3 -m http.server 8113 |
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
"""python-mailer.py | |
Author : Vishnu Ashok | |
Contact : [email protected] | |
[email protected] | |
GitHub : http://github.com/p53ud0k0d3 | |
This is a simple email client program, which can be used to send emails from Gmail and Hotmail. | |
You must enable "Allow less secure apps" in Gmail settings. | |
""" |