Skip to content

Instantly share code, notes, and snippets.

View libert-xyz's full-sized avatar
🗽
/dev/urandom

Libert Schmidt libert-xyz

🗽
/dev/urandom
View GitHub Profile
#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
@libert-xyz
libert-xyz / avg_dic.py
Created June 27, 2016 15:48
Finding the percentage
#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: '))
@libert-xyz
libert-xyz / list_hacker.py
Created June 28, 2016 17:06
Each command will be of the commands given above. The extend(L) method will not be used. Each command will have its own value(s) separated by a space.
#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)
#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(" ")))))
@libert-xyz
libert-xyz / set_hacker.py
Created June 30, 2016 16:49
Sets - Symmetric Difference
#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)
@libert-xyz
libert-xyz / secondLarger_hack.py
Created July 1, 2016 17:01
NOTE: Do not use the insertion sort method.
#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)
@libert-xyz
libert-xyz / nested_hacker.py
Created July 2, 2016 05:49
There will always be one or more students having the second lowest grade.
#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())])
@libert-xyz
libert-xyz / sWAPcASE.py
Created July 2, 2016 18:06
Your task is to swap cases. In other words, convert all lowercase letters to uppercase letters and vice versa. (Without swapcase() )
#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)
#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())
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "statement1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::acct:user/devuser"
},
"Action": [