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
n,x=map(int, raw_input().split()) | |
marks=[] | |
for i in range(x): | |
arr=map(float,raw_input().split()) | |
marks.append(arr) | |
for points in zip(*marks): | |
print "%s" %(sum(points)/len(points)) |
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
n,m=map(int,raw_input().split()) | |
A=[] | |
B=[] | |
C=[] | |
for _ in range(n): | |
A.append(raw_input()) | |
for _ in range(m): | |
B.append(raw_input()) | |
for item in B: | |
for i in range(len(A)): |
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
n, ss=int(raw_input()), map(int,raw_input().split()) | |
money=0 | |
for i in range(int(raw_input())): | |
item,price=map(int, raw_input().split()) | |
try: | |
ss.remove(item) | |
money=money+price | |
except: | |
continue | |
print money |
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
for i in range(int(raw_input())): | |
try: | |
a,b=map(int,raw_input().split()) | |
print a/b | |
except ZeroDivisionError as e: | |
print "Error Code:", e | |
except ValueError as e: | |
print "Error Code:", e |
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
A=set(map(int,raw_input().split())) | |
n=int(raw_input()) | |
result="False" | |
for i in range(n): | |
a=set(map(int, raw_input().split())) | |
if len(a) == len(a.intersection(A)): | |
result="True" | |
a=set() | |
else: | |
result="False" |
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
for i in range(int(raw_input())): #More than 4 lines will result in 0 score. Blank lines won't be counted. | |
a = int(raw_input()); A = set(raw_input().split()) | |
b = int(raw_input()); B = set(raw_input().split()) | |
if len(A) == len(A.intersection(B)): | |
print "True" | |
else: | |
print "False" |
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
n=int(raw_input()) | |
a=set(map(int, raw_input().split())) | |
N=int(raw_input()) | |
for i in range(N): | |
com=raw_input().split() | |
if len(com)==2: | |
if com[0]=="intersection_update": | |
b=set(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
#!/bin/bash | |
## install node and set permission | |
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - | |
sudo apt-get update | |
sudo apt-get install -y nodejs | |
sudo npm install -g gulp | |
sudo npm install -g bower | |
sudo npm install -g gulp-cli |
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
if __name__ == '__main__': | |
n = int(raw_input()) | |
student_marks = {} | |
for _ in range(n): | |
line = raw_input().split() | |
name, scores = line[0], line[1:] | |
scores = map(float, scores) | |
student_marks[name] = scores | |
query_name = 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
arr = [] | |
point = [] | |
for _ in range(int(raw_input())): | |
name = raw_input() | |
score = float(raw_input()) | |
point.append(score) | |
temp_list = [name,score] | |
arr.append(temp_list) | |
n=min(point) |