Skip to content

Instantly share code, notes, and snippets.

View antosha417's full-sized avatar
🌴
On vacation

Anton Kavalkou antosha417

🌴
On vacation
View GitHub Profile
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": {
"slide_type": "slide"
@antosha417
antosha417 / NumPy.ipynb
Created March 15, 2019 12:44
Пример работы с NumPy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@antosha417
antosha417 / 10.py
Last active October 19, 2019 15:23
int number_of_lines = int(input())
summary = {}
for _ in range(number_of_lines):
customer_name, item, amount = input().split()
summary[customer_name] = {item: amount} # так в итоге выведем только последнюю покупку для каждого покупателя
####################################################################################################################################
@antosha417
antosha417 / sudoku.py
Last active December 5, 2019 21:51
Sudoku checker Антон Ковальков kovalkov.av@phystech.edu
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))