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
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add - | |
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' | |
sudo apt-get update | |
sudo apt-get install jenkins |
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 wrap(string, max_width): | |
return textwrap.fill(string,max_width) |
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
#Replace all ______ with rjust, ljust or center. | |
thickness = int(raw_input()) #This must be an odd number | |
c = 'H' | |
#Top Cone | |
for i in range(thickness): | |
print (c*i).rjust(thickness-1)+c+(c*i).ljust(thickness-1) | |
#Top Pillars |
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
if __name__ == '__main__': | |
s = raw_input() | |
print any(c.isalnum() for c in s) | |
print any(c.isalpha() for c in s) | |
print any(c.isdigit() for c in s) | |
print any(c.islower() for c in s) | |
print any(c.isupper() for c in s) |
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 count_substring(string, sub_string): | |
count = 0 | |
for i in range(len(string)-len(sub_string)+1): | |
if(string[i:i+len(sub_string)]==sub_string): | |
count += 1 | |
return count |
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 mutate_string(string, position, character): | |
l = list(string) | |
l[position] = c | |
return "".join(l) |
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 print_full_name(a, b): | |
print "Hello {0} {1}! You just delved into python.".format(a, b) |
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 split_and_join(line): | |
# write your code here | |
return("-".join(line.split())) |
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 swap_case(s): | |
return s.swapcase() |
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
n = int(raw_input()) | |
mydict = {} | |
for line in range(n): | |
info = raw_input().split(" ") | |
score = map(float, info[1:]) | |
mydict[info[0]] = sum(score) / float(len(score)) | |
print "%.2f" % round(mydict[raw_input()],2) |