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/bash | |
################################################################################ | |
# | |
# This script automates the installation of the mFi controller software on the | |
# Raspberry Pi. | |
# | |
# http://www.technologist.site/ubnt | |
# | |
################################################################################ |
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
//Homework 2 - "Pet shop tasks" | |
protocol FeedProtocol { | |
func feeding() | |
} | |
protocol JailProtocol { | |
func needsCage() | |
} |
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 presents_for_all_nearby(cmd): | |
global presents, good_kids_left | |
possible_moves = ['up', 'down', 'left', 'right'] | |
if cmd == 'up': | |
possible_moves.remove('down') | |
elif cmd == 'down': | |
possible_moves.remove('up') | |
elif cmd == 'left': | |
possible_moves.remove('right') |
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
from _collections import deque | |
import math | |
inp_raw = input().split() | |
operator = ["*", "+", "-", "/"] | |
evaluate_list = deque() | |
result = 0 | |
for el in inp_raw: | |
result = 0 |
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
from _collections import deque | |
my_list = input().split() | |
print(my_list) | |
operator = ["*", "+", "-", "/"] | |
evaluate_list = deque() | |
result = 0 | |
for el in my_list: | |
if el not in operator: |
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
from _collections import deque | |
inp_raw = input().split() | |
operator = ["*", "+", "-", "/"] | |
evaluate_list = deque() | |
result = 0 | |
for el in inp_raw: | |
result = 0 | |
if el not in operator: | |
current_digit = int(el) |
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
from collections import deque | |
from operator import add, sub, mul, truediv | |
from math import floor | |
expression = deque(input().split()) | |
math_ops = {"+": add, "-": sub, "*": mul, "/": truediv} | |
tmp, output = deque([]), [] | |
while expression: | |
x = expression.popleft() |
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()) | |
matrix = [input().split() for _ in range(n)] | |
start_position = tuple((r, c) for r in range(n) for c in range(n) if matrix[r][c] == 'B') | |
row, col = start_position[0][0], start_position[0][1] | |
possible_directions = { | |
'up': [[], []], | |
'down': [[], []], | |
'left': [[], []], | |
'right': [[], []]} |
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
# int output 75/100 | |
reversed_li = "".join(list(input().split('|')[::-1])).replace(' ', '') | |
print(*[int(i) for i in reversed_li]) | |
# Преработено с помоща на Дилиана Джо | |
user_input = reversed(input().split("|")) | |
matrix = [li.split() for li in user_input] | |
print(" ".join(num for li in matrix for num in li)) |
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
rows, cols = list(map(int, input().split())) | |
matrix = [input().split() for i in range(rows)] | |
indices = [] | |
for li in range(len(matrix)): | |
for i, char in enumerate(matrix[li]): | |
if len(matrix[li]) == cols: | |
if i == cols-1: | |
continue | |
elif matrix[li][i] == matrix[li][i+1]: |
NewerOlder