Skip to content

Instantly share code, notes, and snippets.

@antosha417
antosha417 / sudoku.py
Last active Dec 5, 2019
Sudoku checker Антон Ковальков kovalkov.av@phystech.edu
View sudoku.py
NUMBERS_IN_ROW = sorted(range(1, 10))
def check_row(row):
# all x in NUMBERS_IN_ROW needed if row is smth like ['hello', True, 1, 5.5] or else sorted will throw
return all(map(lambda x: x in NUMBERS_IN_ROW, row)) and sorted(row) == NUMBERS_IN_ROW
def check_rows(matrix):
return all(map(check_row, matrix))
View 10.py
int number_of_lines = int(input())
summary = {}
for _ in range(number_of_lines):
customer_name, item, amount = input().split()
summary[customer_name] = {item: amount} # так в итоге выведем только последнюю покупку для каждого покупателя
####################################################################################################################################
View ping.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@antosha417
antosha417 / NumPy.ipynb
Created Mar 15, 2019
Пример работы с NumPy
View NumPy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Opty full
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "196b8a50-3d29-45c3-82b9-f4a09b49491d"
},
"slideshow": {