Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ee1e27f
Кондюрина Вера, задание 1
AirCloudVera Sep 20, 2025
45b50cf
Кондюрина Вера, Б12-512, задания 2-7
AirCloudVera Sep 23, 2025
cddad44
Improved tasks 4-7
AirCloudVera Sep 26, 2025
2865b14
fix code format, tasks 2-7
AirCloudVera Sep 26, 2025
e5f2a7c
change format
AirCloudVera Sep 26, 2025
1546935
new json file
AirCloudVera Sep 26, 2025
89380d8
modified
AirCloudVera Sep 26, 2025
e1ff4ae
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Oct 4, 2025
8759620
check branch task1_lesson03
AirCloudVera Oct 4, 2025
a3a30aa
Add solution for task 1
AirCloudVera Oct 8, 2025
b63f1de
Add solution for task 2
AirCloudVera Oct 8, 2025
7479fe2
Add solution for task 3
AirCloudVera Oct 8, 2025
b649cfe
Кондюрина Вера, Б12-512
AirCloudVera Oct 10, 2025
1419b1f
Fix format
AirCloudVera Oct 10, 2025
c7a4b5c
Fix format
AirCloudVera Oct 10, 2025
58a56be
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Oct 11, 2025
5bd8a68
Кондюрина Вера, 512, 3 contest
AirCloudVera Oct 17, 2025
38cee76
Merge branch 'main' into main
AirCloudVera Oct 17, 2025
ca71834
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Oct 18, 2025
75f0fa7
Кондюрина Вера, 512
AirCloudVera Oct 24, 2025
ebda55b
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Oct 25, 2025
fcf4bba
512, Кондюрина Вера
AirCloudVera Oct 31, 2025
8396f80
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Nov 8, 2025
5db8290
512, Кондюрина Вера, 8 домашка
AirCloudVera Nov 12, 2025
495491b
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Nov 22, 2025
c735d27
Кондюрина Вера, 512, hw1
AirCloudVera Nov 30, 2025
5679fb3
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Nov 30, 2025
f1f08bf
fix hw1
AirCloudVera Nov 30, 2025
8da6c96
fix format aggregate_segmentation
AirCloudVera Nov 30, 2025
f86df7b
Update aggregate_segmentation.py
AirCloudVera Nov 30, 2025
46cca58
Merge branch 'main' of github.com:AirCloudVera/python_mipt_dafe_tasks
AirCloudVera Nov 30, 2025
1ee5200
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Nov 30, 2025
92a25a7
Merge branch 'main' of github.com:AirCloudVera/python_mipt_dafe_tasks
AirCloudVera Nov 30, 2025
32b5b06
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Dec 5, 2025
a67152e
512, Vera Kondyurina, contest 11
AirCloudVera Dec 5, 2025
c66b376
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Dec 11, 2025
7c6c739
512, Кондюрина Вера, контест 12
AirCloudVera Dec 12, 2025
ce446be
Merge branch 'main' of github.com:AirCloudVera/python_mipt_dafe_tasks
AirCloudVera Feb 28, 2026
1952edc
Add homework 1
AirCloudVera Mar 5, 2026
8e1d659
Fixe tasks
AirCloudVera Mar 6, 2026
6f2ea46
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Mar 12, 2026
b78105c
all
AirCloudVera Mar 12, 2026
c6387c6
Add homework 2
AirCloudVera Mar 13, 2026
811e70a
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Mar 14, 2026
51fddea
Add homework 5
AirCloudVera Mar 20, 2026
c977619
Add homework 5
AirCloudVera Mar 20, 2026
33da21e
Merge branch 'main' into main_2_sem
AirCloudVera Mar 20, 2026
3e24953
Fix code format
AirCloudVera Mar 20, 2026
6b8ead4
Fixed merge conflicts in lesson 05
AirCloudVera Mar 20, 2026
18946c8
Fixed merge conflicts in lesson 05
AirCloudVera Mar 20, 2026
6451891
Fix code
AirCloudVera Mar 20, 2026
d9046af
Merge branch 'main_2_sem'
AirCloudVera Mar 20, 2026
7f39c26
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Apr 10, 2026
378cbfd
Homework diagramms
AirCloudVera Apr 10, 2026
1fb37aa
fix lint
AirCloudVera Apr 10, 2026
fa8762e
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera Apr 11, 2026
6fb26b7
Merge branch 'main' of github.com:AirCloudVera/python_mipt_dafe_tasks
AirCloudVera Apr 11, 2026
c2e9558
fix format
AirCloudVera Apr 11, 2026
29586ee
fix attempt 2
AirCloudVera Apr 11, 2026
5ece644
Homework animation
AirCloudVera Apr 17, 2026
bfac25d
Fix linter
AirCloudVera Apr 17, 2026
0e5c3e7
Merge branch 'EvgrafovMichail:main' into main
AirCloudVera May 1, 2026
c7283e4
Add titanic homework
AirCloudVera May 1, 2026
6796894
Fix format
AirCloudVera May 1, 2026
5a4f6f5
Fix lint
AirCloudVera May 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
16 changes: 8 additions & 8 deletions deprecated_tests/sem01/tests/test_lesson02_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.mark.parametrize(
"num, result_expected",
"num, result_expected",
(
pytest.param(
0,
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_get_factorial(num: int, result_expected: int) -> None:


@pytest.mark.parametrize(
"num, result_expected",
"num, result_expected",
(
pytest.param(
0,
Expand Down Expand Up @@ -83,7 +83,7 @@ def test_get_doubled_factorial(num: int, result_expected: int) -> None:


@pytest.mark.parametrize(
"num, result_expected",
"num, result_expected",
(
pytest.param(
1,
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_get_amount_of_ways_to_climb(


@pytest.mark.parametrize(
"num, result_expected",
"num, result_expected",
(
pytest.param(
1,
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_get_multiplications_amount(


@pytest.mark.parametrize(
"num1, num2, result_expected",
"num1, num2, result_expected",
(
pytest.param(
1,
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_get_gcd(


@pytest.mark.parametrize(
"num, result_expected",
"num, result_expected",
(
pytest.param(
1,
Expand Down Expand Up @@ -273,10 +273,10 @@ def test_get_sum_of_prime_divisors(num: int, result_expected: int) -> None:


@pytest.mark.parametrize(
"num, result_expected",
"num, result_expected",
(
pytest.param(
-10**10,
-(10**10),
False,
id="negative-ten-billion",
),
Expand Down
71 changes: 44 additions & 27 deletions deprecated_tests/sem01/tests/test_lesson04_tasks.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import pytest
import random

from solutions.sem01.lesson04.task1 import is_arithmetic_progression
from solutions.sem01.lesson04.task2 import merge_intervals
from solutions.sem01.lesson04.task3 import find_single_number
from solutions.sem01.lesson04.task4 import move_zeros_to_end
from solutions.sem01.lesson04.task5 import find_row_with_most_ones
import pytest

from solutions.sem01.lesson04.task6 import count_cycles

"""
# 1
@pytest.mark.parametrize("lst, expected", [
pytest.param([], True, id="empty_list"),
pytest.param([5], True, id="single_element"),
Expand All @@ -20,40 +16,52 @@
pytest.param([1, 1, 1, 1], True, id="constant_sequence"),
pytest.param([1, 2, 3, 5], False, id="almost_ap_but_not"),
pytest.param([0, 0, 1], False, id="two_same_one_different"),
pytest.param([10**5 + i*10**2 for i in range(1000)], True, id="long_list_true"),
pytest.param([10**5 + i*10**2 for i in range(999)] + [1], False, id="long_list_false"),
pytest.param([10**5 + i*10**2 for i in range(1000)],
True, id="long_list_true"),
pytest.param([10**5 + i*10**2 for i in range(999)] +
[1], False, id="long_list_false"),
])
def test_is_arithmetic_progression_parametrized(lst, expected):
if len(lst) > 500:
random.shuffle(lst)
assert is_arithmetic_progression(lst) == expected


# 2
@pytest.mark.parametrize("intervals, expected", [
pytest.param([], [], id="empty"),
pytest.param([[1, 3]], [[1, 3]], id="single_interval"),
pytest.param([[10, 13], [1, 3], [2, 6], [8, 10], [15, 18]], [[1, 6], [8, 13], [15, 18]], id="classic_merge"),
pytest.param([[10, 13], [1, 3], [2, 6], [8, 10], [15, 18]], [
[1, 6], [8, 13], [15, 18]], id="classic_merge"),
pytest.param([[1, 4], [4, 5]], [[1, 5]], id="touching_intervals"),
pytest.param([[1, 4], [2, 3]], [[1, 4]], id="nested_interval"),
pytest.param([[5, 7], [1, 3], [15, 20], [0, 0], [2, 4], [6, 10], [0, 2]], [[0, 4], [5, 10], [15, 20]], id="unsorted_input"),
pytest.param([[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]], id="no_overlap"),
pytest.param([[1, 10], [2, 3], [4, 5], [6, 7]], [[1, 10]], id="all_merged"),
pytest.param([[5, 7], [1, 3], [15, 20], [0, 0], [2, 4], [6, 10], [0, 2]], [
[0, 4], [5, 10], [15, 20]], id="unsorted_input"),
pytest.param([[1, 2], [3, 4], [5, 6]], [
[1, 2], [3, 4], [5, 6]], id="no_overlap"),
pytest.param([[1, 10], [2, 3], [4, 5], [6, 7]],
[[1, 10]], id="all_merged"),
])
def test_merge_intervals(intervals, expected):
assert merge_intervals(intervals) == expected


# 3
@pytest.mark.parametrize("nums, expected", [
pytest.param([2, 2, 1], 1, id="simple_case"),
pytest.param([4, 1, 2, 1, 2], 4, id="middle_single"),
pytest.param([1], 1, id="single_element"),
pytest.param([100, 200, 300, 200, 100], 300, id="large_numbers"),
pytest.param([0, 1, 0], 1, id="with_zero"),
pytest.param([7, 8, 9, 8, 7], 9, id="unsorted"),
pytest.param([i + 10**5 for i in range(500)] + [i + 10**5 for i in range(500)] + [69], 69, id="long_list"),
pytest.param([i + 10**5 for i in range(500)] +
[i + 10**5 for i in range(500)] + [69], 69, id="long_list"),
])
def test_find_single_number(nums, expected):
assert find_single_number(nums) == expected


# 4
@pytest.mark.parametrize("input_list, expected_list, expected_index", [
pytest.param([0, 1, 0, 3, 12], [1, 3, 12, 0, 0], 3, id="basic"),
pytest.param([0, 0, 1], [1, 0, 0], 1, id="zeros_first"),
Expand All @@ -71,6 +79,9 @@ def test_move_zeros_to_end_parametrized(input_list, expected_list, expected_inde
assert result_index == expected_index


# 5


@pytest.mark.parametrize("matrix, expected_row", [
pytest.param(
[[0, 0, 1, 1],
Expand Down Expand Up @@ -119,8 +130,8 @@ def test_move_zeros_to_end_parametrized(input_list, expected_list, expected_inde
pytest.param(
[[0, 0, 1],
[0, 1, 1],
[0, 1, 1]],
1,
[0, 1, 1]],
1,
id="tie"
),
])
Expand All @@ -144,16 +155,22 @@ def test_find_row_with_most_ones_big_data():
assert find_row_with_most_ones(matrix) == 1


@pytest.mark.parametrize("input_arr, expected", [
pytest.param([0], 1, id="self_loop"),
pytest.param([1, 0], 1, id="two_cycle"),
pytest.param([1, 2, 0], 1, id="three_cycle"),
pytest.param([0, 1, 2], 3, id="three_self_loops"),
pytest.param([1, 0, 3, 2], 2, id="two_2_cycles"),
pytest.param([2, 0, 1, 4, 3], 2, id="mixed_cycles"),
pytest.param([10, 6, 2, 9, 4, 0, 3, 8, 7, 1, 5], 5, id="mixed_cycles"),
pytest.param([], 0, id="empty"),
])
"""


@pytest.mark.parametrize(
"input_arr, expected",
[
pytest.param([0], 1, id="self_loop"),
pytest.param([1, 0], 1, id="two_cycle"),
pytest.param([1, 2, 0], 1, id="three_cycle"),
pytest.param([0, 1, 2], 3, id="three_self_loops"),
pytest.param([1, 0, 3, 2], 2, id="two_2_cycles"),
pytest.param([2, 0, 1, 4, 3], 2, id="mixed_cycles"),
pytest.param([10, 6, 2, 9, 4, 0, 3, 8, 7, 1, 5], 5, id="mixed_cycles"),
pytest.param([], 0, id="empty"),
],
)
def test_count_cycles(input_arr, expected):
arr = input_arr[:]
assert count_cycles(arr) == expected
67 changes: 36 additions & 31 deletions deprecated_tests/sem01/tests/test_lesson05_tasks.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import pytest
import pytest

from solutions.sem01.lesson05.task1 import is_palindrome
from solutions.sem01.lesson05.task2 import are_anagrams
from solutions.sem01.lesson05.task3 import is_punctuation
from solutions.sem01.lesson05.task4 import unzip
from solutions.sem01.lesson05.task5 import reg_validator
from solutions.sem01.lesson05.task6 import simplify_path

"""
@pytest.mark.parametrize("s, expected", [
pytest.param("", True, id="empty_string"),
pytest.param("a", True, id="single_char"),
Expand All @@ -27,6 +23,8 @@ def test_is_palindrome(s, expected):
assert is_palindrome(s) == expected




@pytest.mark.parametrize("w1, w2, expected", [
pytest.param("listen", "silent", True, id="classic_anagram"),
pytest.param("evil", "vile", True, id="another_anagram"),
Expand Down Expand Up @@ -61,6 +59,7 @@ def test_are_anagrams_linear(w1, w2, expected):
def test_is_only_punctuation(s, expected):
assert is_punctuation(s) == expected


@pytest.mark.parametrize("compressed, expected", [
pytest.param("AbcD*4 ef GhI*2", "AbcDAbcDAbcDAbcDefGhIGhI", id="example"),
pytest.param("a*3 b*2", "aaabb", id="simple_letters"),
Expand All @@ -75,6 +74,7 @@ def test_is_only_punctuation(s, expected):
def test_decompress(compressed, expected):
assert unzip(compressed) == expected


@pytest.mark.parametrize("regexp, s, expected", [
pytest.param("d", "123", True, id="d_valid_number"),
pytest.param("d", "0", True, id="d_zero"),
Expand Down Expand Up @@ -118,34 +118,39 @@ def test_decompress(compressed, expected):
pytest.param("s", "1a", True, id="s_digit_letter"),
pytest.param("s", "a!1", False, id="s_contains_exclamation"),
pytest.param("d-w-s", "123-abc-XY1Z23", True, id="d_w_s_valid"),
pytest.param("d-w-s", "123-abc-XYZ_123", False, id="d_w_s_underscore_in_s"),
pytest.param("d-w-s", "123-abc-XYZ_123", False,
id="d_w_s_underscore_in_s"),
])
def test_match_pattern(regexp, s, expected):
assert reg_validator(regexp, s) == expected
"""


@pytest.mark.parametrize("path, expected", [
pytest.param("/home/", "/home", id="trailing_slash"),
pytest.param("/../", "", id="go_above_root"),
pytest.param("/home//foo/", "/home/foo", id="double_slash"),
pytest.param("/home/./foo/", "/home/foo", id="current_dir_dot"),
pytest.param("/./././", "/", id="only_dots_and_slashes"),
pytest.param("/a/./b/../../c/", "/c", id="complex_up_and_down"),
pytest.param("/a/b/c/../../../", "/", id="back_to_root"),
pytest.param("/", "/", id="root_only"),
pytest.param("/.", "/", id="root_with_dot"),
pytest.param("/..", "", id="root_with_double_dot"),
pytest.param("/...", "/...", id="triple_dot_as_name"),
pytest.param("/..a", "/..a", id="dot_dot_a_as_name"),
pytest.param("/a.b/c.d", "/a.b/c.d", id="names_with_dots"),
pytest.param("/a//b////c/d//././/..", "/a/b/c", id="messy_path"),
pytest.param("/a/./b/./c/./d", "/a/b/c/d", id="dots_everywhere"),
pytest.param("/a/./b/../../c/./d/", "/c/d", id="up_down_with_dots"),
pytest.param("/../foo", "", id="up_then_valid"),
pytest.param("/../../foo", "", id="multiple_up_then_valid"),
pytest.param("/../../../", "", id="three_up_from_root"),
pytest.param("/home/foo/./../../../", "", id="too_many_up"),
pytest.param("/_a.b/c__1/..", "/_a.b", id="names_with_underscores_and_dots"),
])
@pytest.mark.parametrize(
"path, expected",
[
pytest.param("/home/", "/home", id="trailing_slash"),
pytest.param("/../", "", id="go_above_root"),
pytest.param("/home//foo/", "/home/foo", id="double_slash"),
pytest.param("/home/./foo/", "/home/foo", id="current_dir_dot"),
pytest.param("/./././", "/", id="only_dots_and_slashes"),
pytest.param("/a/./b/../../c/", "/c", id="complex_up_and_down"),
pytest.param("/a/b/c/../../../", "/", id="back_to_root"),
pytest.param("/", "/", id="root_only"),
pytest.param("/.", "/", id="root_with_dot"),
pytest.param("/..", "", id="root_with_double_dot"),
pytest.param("/...", "/...", id="triple_dot_as_name"),
pytest.param("/..a", "/..a", id="dot_dot_a_as_name"),
pytest.param("/a.b/c.d", "/a.b/c.d", id="names_with_dots"),
pytest.param("/a//b////c/d//././/..", "/a/b/c", id="messy_path"),
pytest.param("/a/./b/./c/./d", "/a/b/c/d", id="dots_everywhere"),
pytest.param("/a/./b/../../c/./d/", "/c/d", id="up_down_with_dots"),
pytest.param("/../foo", "", id="up_then_valid"),
pytest.param("/../../foo", "", id="multiple_up_then_valid"),
pytest.param("/../../../", "", id="three_up_from_root"),
pytest.param("/home/foo/./../../../", "", id="too_many_up"),
pytest.param("/_a.b/c__1/..", "/_a.b", id="names_with_underscores_and_dots"),
],
)
def test_simplify_path(path, expected):
assert simplify_path(path) == expected
assert simplify_path(path) == expected
Loading
Loading