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
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)) |
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
int number_of_lines = int(input()) | |
summary = {} | |
for _ in range(number_of_lines): | |
customer_name, item, amount = input().split() | |
summary[customer_name] = {item: amount} # так в итоге выведем только последнюю покупку для каждого покупателя | |
#################################################################################################################################### | |
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.
This file has been truncated, but you can view the full file.
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"nbpresent": { | |
"id": "196b8a50-3d29-45c3-82b9-f4a09b49491d" | |
}, | |
"slideshow": { | |
"slide_type": "slide" |