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
# Напишите программу, которая принимает на вход координаты двух точек и находит расстояние | |
# между ними в 2D пространстве. | |
# | |
# Пример: | |
# | |
# - A (3,6); B (2,1) -> 5,09 | |
# - A (7,-5); B (1,-1) -> 7,21 | |
# from math import sqrt | |
# |
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
# Создайте программу для игры с конфетами человек против человека. | |
# | |
# Условие задачи: На столе лежит 2021 конфета. Играют два игрока делая ход друг после друга. | |
# Первый ход определяется жеребьёвкой. За один ход можно забрать не более чем 28 конфет. | |
# Все конфеты оппонента достаются сделавшему последний ход. | |
# Сколько конфет нужно взять первому игроку, чтобы забрать все конфеты у своего конкурента? | |
# | |
# a) Добавьте игру против бота | |
# | |
# b) Подумайте как наделить бота ""интеллектом"" |
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
# Вычислить число c заданной точностью d | |
# | |
# Пример: | |
# | |
# - при d = 0.001, π = 3.141 10^{-1} ≤ d ≤10^{-10} | |
# | |
# n = 5 | |
# a = 1.2345678912345 |
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
# Задайте список из нескольких чисел. Напишите программу, | |
# которая найдёт сумму элементов списка, стоящих на нечётной позиции. | |
# | |
# Пример: | |
# | |
# - [2, 3, 5, 9, 3] -> на нечётных позициях элементы 3 и 9, ответ: 12 | |
# | |
# def is_zero_waste(a): | |
# if a%2 != 0: | |
# return True |
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
# Напишите программу, которая принимает на вход цифру, обозначающую день недели, и проверяет, является ли этот день выходным. | |
# | |
# Пример: | |
# | |
# - 6 -> да | |
# - 7 -> да | |
# - 1 -> нет | |
# | |
# def is_weekday(n): |
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
# Напишите программу, которая принимает на вход цифру, обозначающую день недели, и проверяет, является ли этот день выходным. | |
# | |
# Пример: | |
# | |
# - 6 -> да | |
# - 7 -> да | |
# - 1 -> нет | |
# | |
# def is_weekday(n): |