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
using System; | |
public class HelloWorld | |
{ | |
private const string Greetings = "Hello, World!"; | |
public string Hello() | |
{ | |
return Greetings; | |
} |
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
import glob | |
files = glob.glob("*.csv") | |
header_saved = False | |
with open('output.csv', 'w') as fout: | |
for file in files: | |
with open(file) as fin: | |
header = next(fin) | |
if not header_saved: |
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
#!/usr/bin/env python3 | |
""" | |
Essentially just a python script to run the sql command below. | |
mysqlimport --ignore-lines=1 --fields-terminated-by=, --columns=csv_headers --local -u root -p db_name file.csv | |
""" | |
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
#!/bin/python3 | |
import re | |
n = int(input().strip()) | |
s = "{0:b}".format(n) | |
out = max(len(a) for a in re.findall(r'1+', s)) | |
print(out) |
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(input()) | |
def factorial(n): | |
if n == 0: | |
return 1 | |
else: | |
return n * factorial(n-1) | |
print(factorial(n)) |
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(input()) | |
book = dict(input().split() for _ in range(n)) | |
while(1): | |
try: | |
person = input() | |
if person in book: | |
print('%s=%s' % (person, book[person])) | |
else: | |
print('Not found') |
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
#!/bin/python3 | |
import sys | |
n = int(input().strip()) | |
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] | |
print(' '.join(map(str,reversed(arr)))) |
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
import sys | |
t = int(sys.stdin.readline()) | |
for i in range(0, t): | |
arg = sys.stdin.readline() | |
even = [] | |
odd = [] | |
for x in range(0, len(arg)): |
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
#!/bin/python3 | |
import sys | |
n = int(input().strip()) | |
for x in range(1, 11): | |
print("{} x {} = {}".format(n, x, n*x)) |
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
class Person: | |
def __init__(self,initialAge): | |
# Add some more code to run some checks on initialAge | |
if initialAge < 0: | |
self.age = 0 | |
print('Age is not valid, setting age to 0.') | |
self.age = initialAge | |
def amIOld(self): |