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
#rschmidt@libert.xyz | |
#http://www.practicepython.org/exercise/2014/07/05/18-cows-and-bulls.html | |
import random | |
def start(): | |
num = input('Enter a 3 digit number: ') | |
return num |
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
#Finding the percentage | |
#6/27/16 | |
#https://www.hackerrank.com/challenges/finding-the-percentage | |
avg = {} | |
number = input(('Number of students: ')) | |
for i in range(number): | |
name_marks = raw_input(str('Name and Marks: ')) |
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
#6/28/16 | |
#python 3 | |
#https://www.hackerrank.com/challenges/python-lists | |
for i in range(n): | |
command, *args = input().split() | |
if 'print' in command: | |
print (N) |
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
#https://www.hackerrank.com/challenges/python-tuples | |
#06/29/16 | |
#map(function, iterable, ...) | |
#Return an iterator that applies function to every item of iterable, yielding the results. If additional iterable arguments are passed, function must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted. For cases where the function inputs are already arranged into argument tuples, see itertools.starmap(). | |
input() | |
print (hash(tuple(map(int, input().split(" "))))) |
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
#6/30/16 | |
#https://www.hackerrank.com/challenges/sets/forum | |
raw_input() | |
n1 = set(map(int,(raw_input().split()))) | |
raw_input() | |
n2 = set(map(int,(raw_input().split()))) | |
u = n1.symmetric_difference(n2) |
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
#7/1/16 | |
#https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list | |
int(raw_input()) | |
n = map(int,raw_input().split()) | |
maxi = max(n) |
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
#https://www.hackerrank.com/challenges/nested-list | |
#7/2/16 | |
n = int(raw_input()) | |
student = [] | |
for i in range(n): | |
student.append([raw_input(),float(raw_input())]) |
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
#7/2/16 | |
#https://www.hackerrank.com/challenges/swap-case | |
s = [i.lower() if i.isupper() else i.upper() for i in raw_input()] | |
print ''.join(s) |
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
#7/2/16 | |
#https://www.hackerrank.com/challenges/itertools-product | |
from itertools import product | |
a = map(int,raw_input().split()) | |
b = map(int,raw_input().split()) |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "statement1", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::acct:user/devuser" | |
}, | |
"Action": [ |