diff --git a/Week02/__pycache__/other_file.cpython-39.pyc b/Week02/__pycache__/other_file.cpython-39.pyc new file mode 100644 index 00000000..a8ef24e1 Binary files /dev/null and b/Week02/__pycache__/other_file.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_ali_duman.cpython-39.pyc b/Week02/__pycache__/sequences_ali_duman.cpython-39.pyc new file mode 100644 index 00000000..4ed7da03 Binary files /dev/null and b/Week02/__pycache__/sequences_ali_duman.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_bahri_un.cpython-39.pyc b/Week02/__pycache__/sequences_bahri_un.cpython-39.pyc new file mode 100644 index 00000000..be937681 Binary files /dev/null and b/Week02/__pycache__/sequences_bahri_un.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_beyza_saygili.cpython-39.pyc b/Week02/__pycache__/sequences_beyza_saygili.cpython-39.pyc new file mode 100644 index 00000000..45aef75a Binary files /dev/null and b/Week02/__pycache__/sequences_beyza_saygili.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_beyza_sungar.cpython-39.pyc b/Week02/__pycache__/sequences_beyza_sungar.cpython-39.pyc new file mode 100644 index 00000000..e3d0eb30 Binary files /dev/null and b/Week02/__pycache__/sequences_beyza_sungar.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_bilal_ayakdas.cpython-39.pyc b/Week02/__pycache__/sequences_bilal_ayakdas.cpython-39.pyc new file mode 100644 index 00000000..49de5723 Binary files /dev/null and b/Week02/__pycache__/sequences_bilal_ayakdas.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_cengizhan_bayram.cpython-39.pyc b/Week02/__pycache__/sequences_cengizhan_bayram.cpython-39.pyc new file mode 100644 index 00000000..2d67e353 Binary files /dev/null and b/Week02/__pycache__/sequences_cengizhan_bayram.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_emre_bicer.cpython-39.pyc b/Week02/__pycache__/sequences_emre_bicer.cpython-39.pyc new file mode 100644 index 00000000..7c1c1afe Binary files /dev/null and b/Week02/__pycache__/sequences_emre_bicer.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_farid_mammadov.cpython-39.pyc b/Week02/__pycache__/sequences_farid_mammadov.cpython-39.pyc new file mode 100644 index 00000000..d60b39c6 Binary files /dev/null and b/Week02/__pycache__/sequences_farid_mammadov.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_ferhat_kurkcuoglu.cpython-39.pyc b/Week02/__pycache__/sequences_ferhat_kurkcuoglu.cpython-39.pyc new file mode 100644 index 00000000..9de8a898 Binary files /dev/null and b/Week02/__pycache__/sequences_ferhat_kurkcuoglu.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_firat_kaya_ozgenc.cpython-39.pyc b/Week02/__pycache__/sequences_firat_kaya_ozgenc.cpython-39.pyc new file mode 100644 index 00000000..880f4104 Binary files /dev/null and b/Week02/__pycache__/sequences_firat_kaya_ozgenc.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_furkan_baytak.cpython-39.pyc b/Week02/__pycache__/sequences_furkan_baytak.cpython-39.pyc new file mode 100644 index 00000000..be987cb3 Binary files /dev/null and b/Week02/__pycache__/sequences_furkan_baytak.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_irem_dilsat_kose.cpython-39.pyc b/Week02/__pycache__/sequences_irem_dilsat_kose.cpython-39.pyc new file mode 100644 index 00000000..dc202fa8 Binary files /dev/null and b/Week02/__pycache__/sequences_irem_dilsat_kose.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_mehmet_alpergun.cpython-39.pyc b/Week02/__pycache__/sequences_mehmet_alpergun.cpython-39.pyc new file mode 100644 index 00000000..bd904abc Binary files /dev/null and b/Week02/__pycache__/sequences_mehmet_alpergun.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_melisa_sahin.cpython-39.pyc b/Week02/__pycache__/sequences_melisa_sahin.cpython-39.pyc new file mode 100644 index 00000000..eef6f79a Binary files /dev/null and b/Week02/__pycache__/sequences_melisa_sahin.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_mert_can_fidan.cpython-39.pyc b/Week02/__pycache__/sequences_mert_can_fidan.cpython-39.pyc new file mode 100644 index 00000000..4c64641f Binary files /dev/null and b/Week02/__pycache__/sequences_mert_can_fidan.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_muhammet_berk_can.cpython-39.pyc b/Week02/__pycache__/sequences_muhammet_berk_can.cpython-39.pyc new file mode 100644 index 00000000..8fc2aabe Binary files /dev/null and b/Week02/__pycache__/sequences_muhammet_berk_can.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_mustafa_eren_tugcu.cpython-39.pyc b/Week02/__pycache__/sequences_mustafa_eren_tugcu.cpython-39.pyc new file mode 100644 index 00000000..c2f750a5 Binary files /dev/null and b/Week02/__pycache__/sequences_mustafa_eren_tugcu.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_oguz_anil_ates.cpython-39.pyc b/Week02/__pycache__/sequences_oguz_anil_ates.cpython-39.pyc new file mode 100644 index 00000000..d54cd8cf Binary files /dev/null and b/Week02/__pycache__/sequences_oguz_anil_ates.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_orkun_altinyelken.cpython-39.pyc b/Week02/__pycache__/sequences_orkun_altinyelken.cpython-39.pyc new file mode 100644 index 00000000..f5c54a81 Binary files /dev/null and b/Week02/__pycache__/sequences_orkun_altinyelken.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_selvanur_kirac.cpython-39.pyc b/Week02/__pycache__/sequences_selvanur_kirac.cpython-39.pyc new file mode 100644 index 00000000..fdd81768 Binary files /dev/null and b/Week02/__pycache__/sequences_selvanur_kirac.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_yavuz_selim.cpython-39.pyc b/Week02/__pycache__/sequences_yavuz_selim.cpython-39.pyc new file mode 100644 index 00000000..1f4b53ec Binary files /dev/null and b/Week02/__pycache__/sequences_yavuz_selim.cpython-39.pyc differ diff --git a/Week02/__pycache__/sequences_zeynep_soyarslan.cpython-39.pyc b/Week02/__pycache__/sequences_zeynep_soyarslan.cpython-39.pyc new file mode 100644 index 00000000..f7afb573 Binary files /dev/null and b/Week02/__pycache__/sequences_zeynep_soyarslan.cpython-39.pyc differ diff --git a/Week02/__pycache__/test_sequences.cpython-39-pytest-8.1.1.pyc b/Week02/__pycache__/test_sequences.cpython-39-pytest-8.1.1.pyc new file mode 100644 index 00000000..b0e9ae14 Binary files /dev/null and b/Week02/__pycache__/test_sequences.cpython-39-pytest-8.1.1.pyc differ diff --git a/Week02/__pycache__/test_types.cpython-39-pytest-8.1.1.pyc b/Week02/__pycache__/test_types.cpython-39-pytest-8.1.1.pyc new file mode 100644 index 00000000..8130878d Binary files /dev/null and b/Week02/__pycache__/test_types.cpython-39-pytest-8.1.1.pyc differ diff --git a/Week02/__pycache__/types_ali_duman.cpython-39.pyc b/Week02/__pycache__/types_ali_duman.cpython-39.pyc new file mode 100644 index 00000000..2c0db7e4 Binary files /dev/null and b/Week02/__pycache__/types_ali_duman.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_bahri_un.cpython-39.pyc b/Week02/__pycache__/types_bahri_un.cpython-39.pyc new file mode 100644 index 00000000..74dd78e6 Binary files /dev/null and b/Week02/__pycache__/types_bahri_un.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_batuhan_ayyildiz.cpython-39.pyc b/Week02/__pycache__/types_batuhan_ayyildiz.cpython-39.pyc new file mode 100644 index 00000000..22211def Binary files /dev/null and b/Week02/__pycache__/types_batuhan_ayyildiz.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_beyza_saygili.cpython-39.pyc b/Week02/__pycache__/types_beyza_saygili.cpython-39.pyc new file mode 100644 index 00000000..52d02597 Binary files /dev/null and b/Week02/__pycache__/types_beyza_saygili.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_beyza_sungar.cpython-39.pyc b/Week02/__pycache__/types_beyza_sungar.cpython-39.pyc new file mode 100644 index 00000000..6b6cd68c Binary files /dev/null and b/Week02/__pycache__/types_beyza_sungar.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_bilal_ayakdas.cpython-39.pyc b/Week02/__pycache__/types_bilal_ayakdas.cpython-39.pyc new file mode 100644 index 00000000..29e525de Binary files /dev/null and b/Week02/__pycache__/types_bilal_ayakdas.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_cengizhan_bayram.cpython-39.pyc b/Week02/__pycache__/types_cengizhan_bayram.cpython-39.pyc new file mode 100644 index 00000000..b194fb97 Binary files /dev/null and b/Week02/__pycache__/types_cengizhan_bayram.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_cevdetahmet_turan.cpython-39.pyc b/Week02/__pycache__/types_cevdetahmet_turan.cpython-39.pyc new file mode 100644 index 00000000..c3d6285a Binary files /dev/null and b/Week02/__pycache__/types_cevdetahmet_turan.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_dilara_akdeniz.cpython-39.pyc b/Week02/__pycache__/types_dilara_akdeniz.cpython-39.pyc new file mode 100644 index 00000000..51ec463b Binary files /dev/null and b/Week02/__pycache__/types_dilara_akdeniz.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_emre_bicer.cpython-39.pyc b/Week02/__pycache__/types_emre_bicer.cpython-39.pyc new file mode 100644 index 00000000..af1a66ce Binary files /dev/null and b/Week02/__pycache__/types_emre_bicer.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_eren_yuksel.cpython-39.pyc b/Week02/__pycache__/types_eren_yuksel.cpython-39.pyc new file mode 100644 index 00000000..dfc57500 Binary files /dev/null and b/Week02/__pycache__/types_eren_yuksel.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_esra_basoglu.cpython-39.pyc b/Week02/__pycache__/types_esra_basoglu.cpython-39.pyc new file mode 100644 index 00000000..5d8d5a95 Binary files /dev/null and b/Week02/__pycache__/types_esra_basoglu.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_farid_mammadov.cpython-39.pyc b/Week02/__pycache__/types_farid_mammadov.cpython-39.pyc new file mode 100644 index 00000000..0cb4fc3e Binary files /dev/null and b/Week02/__pycache__/types_farid_mammadov.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_ferhat_kurkcuoglu.cpython-39.pyc b/Week02/__pycache__/types_ferhat_kurkcuoglu.cpython-39.pyc new file mode 100644 index 00000000..37ebfac9 Binary files /dev/null and b/Week02/__pycache__/types_ferhat_kurkcuoglu.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_firat_kaya_ozgenc.cpython-39.pyc b/Week02/__pycache__/types_firat_kaya_ozgenc.cpython-39.pyc new file mode 100644 index 00000000..346cc7c1 Binary files /dev/null and b/Week02/__pycache__/types_firat_kaya_ozgenc.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_furkan_baytak.cpython-39.pyc b/Week02/__pycache__/types_furkan_baytak.cpython-39.pyc new file mode 100644 index 00000000..9800317c Binary files /dev/null and b/Week02/__pycache__/types_furkan_baytak.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_irem_dilsat_kose.cpython-39.pyc b/Week02/__pycache__/types_irem_dilsat_kose.cpython-39.pyc new file mode 100644 index 00000000..a1d37200 Binary files /dev/null and b/Week02/__pycache__/types_irem_dilsat_kose.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_mehmet_alpergun.cpython-39.pyc b/Week02/__pycache__/types_mehmet_alpergun.cpython-39.pyc new file mode 100644 index 00000000..31745485 Binary files /dev/null and b/Week02/__pycache__/types_mehmet_alpergun.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_melisa_sahin.cpython-39.pyc b/Week02/__pycache__/types_melisa_sahin.cpython-39.pyc new file mode 100644 index 00000000..6687d785 Binary files /dev/null and b/Week02/__pycache__/types_melisa_sahin.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_melisa_uyar.cpython-39.pyc b/Week02/__pycache__/types_melisa_uyar.cpython-39.pyc new file mode 100644 index 00000000..33d8dfb8 Binary files /dev/null and b/Week02/__pycache__/types_melisa_uyar.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_mert_can_fidan.cpython-39.pyc b/Week02/__pycache__/types_mert_can_fidan.cpython-39.pyc new file mode 100644 index 00000000..c13c620a Binary files /dev/null and b/Week02/__pycache__/types_mert_can_fidan.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_mine_altug.cpython-39.pyc b/Week02/__pycache__/types_mine_altug.cpython-39.pyc new file mode 100644 index 00000000..9dcd6221 Binary files /dev/null and b/Week02/__pycache__/types_mine_altug.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_muhammet_berk_can.cpython-39.pyc b/Week02/__pycache__/types_muhammet_berk_can.cpython-39.pyc new file mode 100644 index 00000000..6cafcc6a Binary files /dev/null and b/Week02/__pycache__/types_muhammet_berk_can.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_mustafa_eren_tugcu.cpython-39.pyc b/Week02/__pycache__/types_mustafa_eren_tugcu.cpython-39.pyc new file mode 100644 index 00000000..3735e051 Binary files /dev/null and b/Week02/__pycache__/types_mustafa_eren_tugcu.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_orkun_altinyelken.cpython-39.pyc b/Week02/__pycache__/types_orkun_altinyelken.cpython-39.pyc new file mode 100644 index 00000000..7282d7f9 Binary files /dev/null and b/Week02/__pycache__/types_orkun_altinyelken.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_selvanur_kirac.cpython-39.pyc b/Week02/__pycache__/types_selvanur_kirac.cpython-39.pyc new file mode 100644 index 00000000..b59d10f3 Binary files /dev/null and b/Week02/__pycache__/types_selvanur_kirac.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_umit_unal.cpython-39.pyc b/Week02/__pycache__/types_umit_unal.cpython-39.pyc new file mode 100644 index 00000000..4cc6c93d Binary files /dev/null and b/Week02/__pycache__/types_umit_unal.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_yavuz_selim.cpython-39.pyc b/Week02/__pycache__/types_yavuz_selim.cpython-39.pyc new file mode 100644 index 00000000..89eb9136 Binary files /dev/null and b/Week02/__pycache__/types_yavuz_selim.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_zehra_karatas.cpython-39.pyc b/Week02/__pycache__/types_zehra_karatas.cpython-39.pyc new file mode 100644 index 00000000..89cc552e Binary files /dev/null and b/Week02/__pycache__/types_zehra_karatas.cpython-39.pyc differ diff --git a/Week02/__pycache__/types_zeynep_soyarslan.cpython-39.pyc b/Week02/__pycache__/types_zeynep_soyarslan.cpython-39.pyc new file mode 100644 index 00000000..91d27529 Binary files /dev/null and b/Week02/__pycache__/types_zeynep_soyarslan.cpython-39.pyc differ diff --git a/Week02/sequences_firat_kaya_ozgenc.py b/Week02/sequences_firat_kaya_ozgenc.py new file mode 100644 index 00000000..044f314d --- /dev/null +++ b/Week02/sequences_firat_kaya_ozgenc.py @@ -0,0 +1,16 @@ +my_list = [1, 2, 3, 3, 4, 5, 5, 5, 6] +my_tuple = (1, 2, 3, 4, 5) +my_set = {1, 2, 3, 4, 5} +my_dict = {'a': 1, 'b': 2, 'c': 3} + +def remove_duplicates(seq): + return list(set(seq)) + +def list_counts(seq): + counts = {} + for item in seq: + counts[item] = counts.get(item, 0) + 1 + return counts + +def reverse_dict(d): + return {v: k for k, v in d.items()} diff --git a/Week02/test_sequences.py.bak b/Week02/test_sequences.py.bak new file mode 100644 index 00000000..3165fcf5 --- /dev/null +++ b/Week02/test_sequences.py.bak @@ -0,0 +1,58 @@ +import os + + +files = [f for f in os.listdir(os.path.dirname(__file__)) if f.startswith("sequences")] +for f in files: + exec("import " + f[:-3] + " as " + f[:-3]) + + +def test_names(): + for f in files: + assert "my_list" in dir(eval(f[:-3])), "my_list is not defined in " + f[:-3] + assert "my_tuple" in dir(eval(f[:-3])), "my_tuple is not defined in " + f[:-3] + assert "my_set" in dir(eval(f[:-3])), "my_set is not defined in " + f[:-3] + assert "my_dict" in dir(eval(f[:-3])), "my_dict is not defined in " + f[:-3] + + +def test_types(): + for f in files: + assert isinstance(eval(f[:-3]).my_list, list), "my_list is not a list in " + f[:-3] + assert isinstance(eval(f[:-3]).my_tuple, tuple), "my_tuple is not a tuple in " + f[:-3] + assert isinstance(eval(f[:-3]).my_set, set), "my_set is not a set in " + f[:-3] + assert isinstance(eval(f[:-3]).my_dict, dict), "my_dict is not a dict in " + f[:-3] + + +def test_remove_duplicates(): + for f in files: + assert eval(f[:-3]).remove_duplicates([1, 2, 3, 3, 4, 5, 5, 5, 6]) == [1, 2, 3, 4, 5, 6], \ + "remove_duplicates is not working in " + f[:-3] + assert eval(f[:-3]).remove_duplicates([1, 2, 3, 4, 5, 6]) == [1, 2, 3, 4, 5, 6], \ + "remove_duplicates is not working in " + f[:-3] + assert eval(f[:-3]).remove_duplicates([1, 1, 1, 1, 1, 1]) == [1], \ + "remove_duplicates is not working in " + f[:-3] + assert eval(f[:-3]).remove_duplicates([]) == [], \ + "remove_duplicates is not working in " + f[:-3] + + +def test_list_counts(): + for f in files: + assert eval(f[:-3]).list_counts([1, 2, 3, 3, 4, 5, 5, 5, 6]) == {1: 1, 2: 1, 3: 2, 4: 1, 5: 3, 6: 1}, \ + "list_counts is not working in " + f[:-3] + assert eval(f[:-3]).list_counts([1, 2, 3, 4, 5, 6]) == {1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1}, \ + "list_counts is not working in " + f[:-3] + assert eval(f[:-3]).list_counts([1, 1, 1, 1, 1, 1]) == {1: 6}, \ + "list_counts is not working in " + f[:-3] + assert eval(f[:-3]).list_counts([]) == {}, \ + "list_counts is not working in " + f[:-3] + + +def test_reverse_dict(): + for f in files: + assert eval(f[:-3]).reverse_dict({1: 1, 2: 2, 3: 3}) == {1: 1, 2: 2, 3: 3}, \ + "reverse_dict is not working in " + f[:-3] + assert eval(f[:-3]).reverse_dict({1: 2, 2: 3, 3: 4}) == {2: 1, 3: 2, 4: 3}, \ + "reverse_dict is not working in " + f[:-3] + assert eval(f[:-3]).reverse_dict({1: 1, 2: 1, 3: 1}) == {1: 3}, \ + "reverse_dict is not working in " + f[:-3] + assert eval(f[:-3]).reverse_dict({}) == {}, \ + "reverse_dict is not working in " + f[:-3] diff --git a/Week02/types_firat_kaya_ozgenc.py b/Week02/types_firat_kaya_ozgenc.py new file mode 100644 index 00000000..ddfcbf83 --- /dev/null +++ b/Week02/types_firat_kaya_ozgenc.py @@ -0,0 +1,4 @@ +my_int = 6 +my_float = 6.6 +my_bool = True +my_complex = 6+6j