├── .gitignore ├── Python-Addicts ├── Title_Case_Challenge.ipynb ├── 'One_Owt_Three_Ruof _Five_Xis_Seven' .ipynb ├── .ipynb_checkpoints │ ├── Title_Case_Challenge-checkpoint.ipynb │ ├── 'One_Owt_Three_Ruof _Five_Xis_Seven' -checkpoint.ipynb │ ├── 18Agustosinclass-checkpoint.ipynb │ ├── 7ye bolunebilenler-checkpoint.ipynb │ ├── Accumulating_List-checkpoint.ipynb │ ├── Add_Dots Functions-checkpoint.ipynb │ ├── Advanced_Sort-checkpoint.ipynb │ ├── Aluminum_Foil-checkpoint.ipynb │ ├── Anagram_Same Letters-checkpoint.ipynb │ ├── Ara_toplam_haric-checkpoint.ipynb │ ├── Array_Challenge_Enerjisa-checkpoint.ipynb │ ├── Artan_düzende_sıralanmış_liste-checkpoint.ipynb │ ├── Astonishing_Number-checkpoint.ipynb │ ├── Atbash Cipher-checkpoint.ipynb │ ├── Basic Calculator-checkpoint.ipynb │ ├── Binary_Cevirme-checkpoint.ipynb │ ├── Bit_Cevirici -checkpoint.ipynb │ ├── Brackets_Balance_Testi -checkpoint.ipynb │ ├── Büyük_küçük harf sayısı-checkpoint.ipynb │ ├── Chinese_Puzzle-checkpoint.ipynb │ ├── ClaruswayBank-checkpoint.ipynb │ ├── Clarusway_Oku_Patterns-checkpoint.ipynb │ ├── Collatz_Dizisi-checkpoint.ipynb │ ├── Comfortable_words-checkpoint.ipynb │ ├── Comma_Separated_Sequence-checkpoint.ipynb │ ├── Cows and Bullsv Game-checkpoint.ipynb │ ├── Datetime_Modülü-checkpoint.ipynb │ ├── Del_Vowels_Sentence-checkpoint.ipynb │ ├── Digits Sum Up10-checkpoint.ipynb │ ├── Digits_Calculate-checkpoint.ipynb │ ├── Directions_Reduction-checkpoint.ipynb │ ├── Disarium Number-checkpoint.ipynb │ ├── Dizi_Olusturma-checkpoint.ipynb │ ├── Domain_Name_URL-checkpoint.ipynb │ ├── Eksik_Cift_Sayilari_Bulma-checkpoint.ipynb │ ├── Everything|waits|for|its|time-checkpoint.ipynb │ ├── Fibonacci dizisi-checkpoint.ipynb │ ├── Filter_Fonksiyonu-checkpoint.ipynb │ ├── First_Non_Repeating_Letter-checkpoint.ipynb │ ├── FizzBuzz_Challenge-checkpoint.ipynb │ ├── Floyd_Ucgeni-checkpoint.ipynb │ ├── Game_Boards-checkpoint.ipynb │ ├── Generate strong passwords-checkpoint.ipynb │ ├── Geometrik_Sekil_Hesaplama-checkpoint.ipynb │ ├── Get the Lucky Number-checkpoint.ipynb │ ├── Girilen sayiyi sorgulama-checkpoint.ipynb │ ├── Group_Anagram_Challenge-checkpoint.ipynb │ ├── Haftanin_Gunleri-checkpoint.ipynb │ ├── Harshad Number-checkpoint.ipynb │ ├── Havuz_Dolum_Challenge-checkpoint.ipynb │ ├── Havuz_doldurma_challenge09.08-checkpoint.ipynb │ ├── Highest_and_Lowest-checkpoint.ipynb │ ├── Highest_scoring_word.-checkpoint.ipynb │ ├── Index_of_Caps_Letter-checkpoint.ipynb │ ├── Isogram_Words-checkpoint.ipynb │ ├── Isomorphic_Strings-checkpoint.ipynb │ ├── Josephus Permutation-checkpoint.ipynb │ ├── Leap_Year-checkpoint.ipynb │ ├── Least_Common_Multiple-checkpoint.ipynb │ ├── Left_Right_Rotation_Strings -checkpoint.ipynb │ ├── Lesteden_Eleman_Cikarma-checkpoint.ipynb │ ├── Lexicographical_Order-checkpoint.ipynb │ ├── List_Target_Challenge-checkpoint.ipynb │ ├── List_of_Tuples-checkpoint.ipynb │ ├── Listeyi_Tersten_Yazdirma-checkpoint.ipynb │ ├── Longest_Alternating_Substring-checkpoint.ipynb │ ├── Longest_Alternating_Substring1-checkpoint.ipynb │ ├── Look_and_Say_Sequence-checkpoint.ipynb │ ├── Lorem_Ipsum_Yazimi-checkpoint.ipynb │ ├── Loves Me, Loves Me Not...-checkpoint.ipynb │ ├── Main_Number-checkpoint.ipynb │ ├── Market kod numarasi-checkpoint.ipynb │ ├── Market_Kod_Numarasi-checkpoint.ipynb │ ├── Matriksler_challenge-checkpoint.ipynb │ ├── Matrix_identity_challenge 09.08 -checkpoint.ipynb │ ├── Max_of_three_numbers-checkpoint.ipynb │ ├── Median_Sequence_of_Numbers-checkpoint.ipynb │ ├── Medyan_Bulma-checkpoint.ipynb │ ├── Minesweeper I_Grid_Game-checkpoint.ipynb │ ├── Minimum Steps to a Palindrome-checkpoint.ipynb │ ├── Morse code_Challenge-checkpoint.ipynb │ ├── Moving to the End-checkpoint.ipynb │ ├── Multiple_Five_Odd_Even-checkpoint.ipynb │ ├── Multiply_by_11-checkpoint.ipynb │ ├── Mükemmel sayılar-checkpoint.ipynb │ ├── Name_Age_Height_Tuples -checkpoint.ipynb │ ├── Next_in_the_Alphabet-checkpoint.ipynb │ ├── Number_Reader-checkpoint.ipynb │ ├── Odd_Even_Sıralama-checkpoint.ipynb │ ├── Odd_Position_Even_Position-checkpoint.ipynb │ ├── Palindrome_challenge08.08-checkpoint.ipynb │ ├── Parantheses_InValidTrue-checkpoint.ipynb │ ├── Pascal_Ucgeni_Challange-checkpoint.ipynb │ ├── Polybius_Square-checkpoint.ipynb │ ├── Polybius_Square_Basic-checkpoint.ipynb │ ├── Possible_Permutations-checkpoint.ipynb │ ├── Power_Sum_Digit_Term-checkpoint.ipynb │ ├── Prime Factors-checkpoint.ipynb │ ├── Prime_Gaps-checkpoint.ipynb │ ├── Prison_break-checkpoint.ipynb │ ├── Pronic_number_challenge -checkpoint.ipynb │ ├── ROT13_Challenge-checkpoint.ipynb │ ├── Rakam ve Harf Sayisi-checkpoint.ipynb │ ├── Read_File_By_one_by-checkpoint.ipynb │ ├── Rearrange_Pos_and_Negatives-checkpoint.ipynb │ ├── Recursion_Function-checkpoint.ipynb │ ├── Remove_Last_Character -checkpoint.ipynb │ ├── Remove_Last_Character-checkpoint.ipynb │ ├── Rich_number_min-checkpoint.ipynb │ ├── Right_Rotation-checkpoint.ipynb │ ├── Rock-Paper-Scissors game-checkpoint.ipynb │ ├── Rotate_Matriks_Challenge-checkpoint.ipynb │ ├── Rubik's_Cube_Challenge-checkpoint.ipynb │ ├── Salyangoz_Sıralaması-checkpoint.ipynb │ ├── Same_value in same_sublist-checkpoint.ipynb │ ├── Sayisal_Kokler-checkpoint.ipynb │ ├── Sekiz_Vezir_Satranc-checkpoint.ipynb │ ├── Sesli_harfleri_sayma-checkpoint.ipynb │ ├── Simplified_Square_Root-checkpoint.ipynb │ ├── Sort_Characters_String_Alphabet-checkpoint.ipynb │ ├── Splitting Up Numbers-checkpoint.ipynb │ ├── Square_Pattern-checkpoint.ipynb │ ├── Stretched Words-checkpoint.ipynb │ ├── Student_Grades_Avereage-checkpoint.ipynb │ ├── Sum of Negative Integers-checkpoint.ipynb │ ├── Sum_of_Evens_Matrix-checkpoint.ipynb │ ├── Sum_of_Nested_List-checkpoint.ipynb │ ├── Tersten_Yazdirma-checkpoint.ipynb │ ├── Tersten_Yazdirma2-checkpoint.ipynb │ ├── The Snake — Area Filling-checkpoint.ipynb │ ├── Total_Seconds -checkpoint.ipynb │ ├── Triangle_Challenge-checkpoint.ipynb │ ├── Truncatable_Primes-checkpoint.ipynb │ ├── Update_Database-checkpoint.ipynb │ ├── Username_Validation-checkpoint.ipynb │ ├── Vowel Replacer-checkpoint.ipynb │ ├── Workshop_Jason-checkpoint.ipynb │ ├── Zodyak_Takvimi burclar-checkpoint.ipynb │ ├── ders calisma map filter all any-checkpoint.ipynb │ ├── preclass-checkpoint.ipynb │ ├── python addicts-checkpoint.ipynb │ ├── sortlist_without.sort()_method-checkpoint.ipynb │ ├── tekrar1-checkpoint.ipynb │ ├── tekrar2-checkpoint.ipynb │ └── xyz ve abc sayilari-checkpoint.ipynb ├── 19-09-2021.txt ├── Accumulating_List.ipynb ├── Add_Dots Functions.ipynb ├── Advanced_Sort.ipynb ├── Aluminum_Foil.ipynb ├── Anagram_Same Letters.ipynb ├── Ara_toplam_haric.ipynb ├── Array_Challenge_Enerjisa.ipynb ├── Artan_Düzende_Sıralanmış_Liste.ipynb ├── Astonishing_Number.ipynb ├── Atbash_Cipher.ipynb ├── Basic_Calculator.ipynb ├── Binary_Cevirme.ipynb ├── Bit_Cevirici .ipynb ├── Brackets_Balance_Testi .ipynb ├── Büyük_Küçük_Harf_Sayısı.ipynb ├── Chinese_Puzzle.ipynb ├── Clarusway_Bank.ipynb ├── Clarusway_Oku_Patterns.ipynb ├── Collatz_Dizisi.ipynb ├── Comfortable_Words_Calismasi.ipynb ├── Comfortable_words.ipynb ├── Comma_Separated_Sequence.ipynb ├── Cows_and_Bulls_Game.ipynb ├── Datetime_Modülü.ipynb ├── Del_Vowels_Sentence.ipynb ├── Ders_Calisma_Map_Filterallany.ipynb ├── Digits_Calculate.ipynb ├── Digits_Sum_Up10.ipynb ├── Directions_Reduction.ipynb ├── Disarium Number.ipynb ├── Dizi_Olusturma.ipynb ├── Domain_Name_URL.ipynb ├── Eksik_Cift_Sayilari_Bulma.ipynb ├── Everything|waits|for|its|time.ipynb ├── Facebook_Likes_Challenge.ipynb ├── Fibonacci dizisi.ipynb ├── Filter_Fonksiyonu.ipynb ├── First_Non_Repeating_Letter.ipynb ├── FizzBuzz_Challenge.ipynb ├── Floyd_Ucgeni.ipynb ├── Game_Boards.ipynb ├── Generate strong passwords.ipynb ├── Geometrik_Sekil_Hesaplama.ipynb ├── Get the Lucky Number.ipynb ├── Girilen_Sayiyi_Sorgulama.ipynb ├── Group_Anagram_Challenge.ipynb ├── Haftanin_Gunleri.ipynb ├── Harshad_Number.ipynb ├── Havuz_Doldurma_Challenge.ipynb ├── Havuz_Dolum_Challenge.ipynb ├── Highest_Scoring_Word.ipynb ├── Highest_and_Lowest.ipynb ├── Index_of_Caps_Letter.ipynb ├── Isogram_Words.ipynb ├── Isomorphic_Strings.ipynb ├── Josephus Permutation.ipynb ├── Leap_Year.ipynb ├── Least_Common_Multiple.ipynb ├── Left_Right_Rotation_Strings .ipynb ├── Lesteden_Eleman_Cikarma.ipynb ├── Lexicographical_Order.ipynb ├── List_Target_Challenge.ipynb ├── List_of_Tuples.ipynb ├── Longest_Alternating_Substring.ipynb ├── Longest_Alternating_Substring1.ipynb ├── Look_and_Say_Sequence.ipynb ├── Lorem_Ipsum_Yazimi.ipynb ├── Loves_Me_Loves_Me_Not.ipynb ├── Main_Number.ipynb ├── Market_Kod_Numarasi.ipynb ├── Matriksler_challenge.ipynb ├── Matrix_Identity_Challenge.ipynb ├── Max_of_Three_Numbers.ipynb ├── Median_Sequence_of_Numbers.ipynb ├── Medyan_Bulma.ipynb ├── MinesweeperI_Grid_Game.ipynb ├── Minimum_Steps_Palindrome.ipynb ├── Morse_Code_Challenge.ipynb ├── Moving_to_the_End.ipynb ├── Multiple_Five_Odd_Even.ipynb ├── Multiply_by_11.ipynb ├── Mükemmel_Sayılar.ipynb ├── Name_Age_Height_Tuples .ipynb ├── Next_in_the_Alphabet.ipynb ├── Number_Place_Value 09.08.ipynb ├── Number_Reader.ipynb ├── Odd_Even_Sıralama.ipynb ├── Odd_Position_Even_Position.ipynb ├── Palindrome_challenge08.08.ipynb ├── Parantheses_InValidTrue.ipynb ├── Parentheses_cluster08.08 .ipynb ├── Parrot_trouble_code_challenge 08.08.ipynb ├── Pascal_Ucgeni_Challange.ipynb ├── Perfect_Number_1-500Challenge.ipynb ├── Polybius_Square.ipynb ├── Polybius_Square_Basic.ipynb ├── Possible_Permutations.ipynb ├── Power_Sum_Digit_Term.ipynb ├── Prime Factors.ipynb ├── Prime_Gaps.ipynb ├── Prime_Number_Factors 09.08.ipynb ├── Prime_factors08.08.ipynb ├── Prison_break.ipynb ├── Pronic_number_challenge .ipynb ├── Python_Addicts.ipynb ├── README.md ├── ROT13_Challenge.ipynb ├── Rakam_ve_Harf_Sayisi.ipynb ├── Read_File_By_one_by.ipynb ├── Rearrange_Pos_and_Negatives.ipynb ├── Recursion_Function.ipynb ├── Remove_Last_Character .ipynb ├── Remove_Last_Character.ipynb ├── Rich_number_min.ipynb ├── Right_Rotation.ipynb ├── Rock_Paper_Scissors_Game.ipynb ├── Rotate_Matriks_Challenge.ipynb ├── Rubik's_Cube_Challenge.ipynb ├── Salyangoz_Sıralaması.ipynb ├── Same_Value_in_Same_Sublist.ipynb ├── Sayisal_Kokler.ipynb ├── Sekiz_Vezir_Satranc.ipynb ├── Sesli_harfleri_sayma.ipynb ├── Simplified_Square_Root.ipynb ├── Sort_Characters_String_Alphabet.ipynb ├── Splitting_Up_Numbers.ipynb ├── Square_Pattern.ipynb ├── Stretched_Words.ipynb ├── Student_Grades_Avereage.ipynb ├── Sum_of_Evens_Matrix.ipynb ├── Sum_of_Negative_Integers.ipynb ├── Sum_of_Nested_List.ipynb ├── Tersten_Yazdirma.ipynb ├── Tersten_Yazdirma2.ipynb ├── The_Snake_Area_Filling.ipynb ├── Total_Seconds .ipynb ├── Triangle_Challenge.ipynb ├── Truncatable_Primes.ipynb ├── Update_Database.ipynb ├── Username_Validation.ipynb ├── Vowel_Replacer.ipynb ├── Xyz_ve_abc_sayilari.ipynb ├── Yediye_bolunebilenler.ipynb ├── Zodyak_Takvimi_burclar.ipynb ├── asal_sayi_calismasi.ipynb ├── rumi.txt └── sortlist_without.sort()_method.ipynb ├── Python-Assignments ├── .ipynb_checkpoints │ ├── Assignment_Armstrong_Number-checkpoint.ipynb │ ├── Assignment_Fibonacci_Numbers-checkpoint.ipynb │ ├── Assignment_Find Minimum_and_Sum_Numbers-checkpoint.ipynb │ ├── Assignment_Fizz_Buzz_Numbers-checkpoint.ipynb │ ├── Assignment_Letters_Count-checkpoint.ipynb │ ├── Assignment_Negative_Meaning-checkpoint.ipynb │ ├── Assignment_Prime_Number-checkpoint.ipynb │ └── Assignment_Your_Factorial-checkpoint.ipynb ├── Assignment_Armstrong_Number.ipynb ├── Assignment_Comfortable_Words.ipynb ├── Assignment_Covid19_Boolean.ipynb ├── Assignment_Covid19_Risk.ipynb ├── Assignment_Fibonacci_Numbers.ipynb ├── Assignment_Find Minimum_and_Sum_Numbers.ipynb ├── Assignment_Fizz_Buzz_Numbers.ipynb ├── Assignment_Letters_Count.ipynb ├── Assignment_Measure_Converter.ipynb ├── Assignment_Negative_Meaning.ipynb ├── Assignment_Password_Reminder.ipynb ├── Assignment_Prime_Number.ipynb ├── Assignment_Prime_Numbers2.ipynb ├── Assignment_Profit_Calculator.ipynb ├── Assignment_The_Most_Frequent_Element.ipynb ├── Assignment_Your_Factorial.ipynb └── README.md ├── Python-Derspaylasim ├── .ipynb_checkpoints │ ├── 05Agulambdapreclass-checkpoint.ipynb │ ├── 15_PythonBasic_9-August-2021-checkpoint.ipynb │ ├── 16Agustospreclass-checkpoint.ipynb │ ├── 17_PythonBasic_18-August-2021-checkpoint.ipynb │ ├── 18_PythonBasic_19-August-2021-checkpoint.ipynb │ ├── 19_PythonBasic_23-August-2021-checkpoint.ipynb │ ├── 20_PythonBasic_26-August-2021-checkpoint.ipynb │ ├── 23Agustosinclass-checkpoint.ipynb │ ├── Facebook_Likes_Challenge-checkpoint.ipynb │ ├── Module_creating and calling Mehmet-checkpoint.ipynb │ └── ZIP_METOT-checkpoint.ipynb ├── 01_PythonBasic_10_June_2021.ipynb ├── 02_PythonBasic_14_June_2021.ipynb ├── 03_PythonBasic_17_June_2021.ipynb ├── 04_PythonBasic_21-June-2021.ipynb ├── 05_PythonBasic_24-June-2021.ipynb ├── 06_PythonBasic_28-June-2021.ipynb ├── 07_PythonBasic_1-July-2021.ipynb ├── 08_PythonBasic_8-July-2021.ipynb ├── 09_PythonBasic_12-July-2021.ipynb ├── 10_PythonBasic_15-July-2021.ipynb ├── 11_PythonBasic_26-July-2021.ipynb ├── 12_PythonBasic_29-July-2021.ipynb ├── 13_PythonBasic_2-August-2021.ipynb ├── 14_PythonBasic_5-August-2021.ipynb ├── 15_PythonBasic_9-August-2021.ipynb ├── 16_PythonBasic_12-August-2021.ipynb ├── 17_PythonBasic_18-August-2021.ipynb ├── 18_PythonBasic_19-August-2021.ipynb ├── 19_PythonBasic_23-August-2021.ipynb ├── 20_PythonBasic_26-August-2021.ipynb ├── 21_PythonBasic_30-August-2021.ipynb ├── 22_PythonBasic_2-September-2021.ipynb ├── 23Agustosinclass.ipynb ├── 23_PythonBasic_9-September-2021.ipynb ├── 31_PythonReview.ipynb ├── oop.py ├── paketler │ ├── __init__.py │ ├── __pycache__ │ │ └── __init__.cpython-38.pyc │ ├── paket1 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-38.pyc │ │ │ └── module1.cpython-38.pyc │ │ └── module1.py │ └── paket2 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-38.pyc │ │ └── module2.cpython-38.pyc │ │ └── module2.py └── python_review_class_notes.md ├── Python-Documents ├── .DS_Store ├── .ipynb_checkpoints │ ├── 02Eylulinclass-checkpoint.ipynb │ ├── 09Eylülinclass-checkpoint.ipynb │ ├── 12Agustosinclass-checkpoint.ipynb │ ├── 19Agustosinclass-checkpoint.ipynb │ ├── 30Agustosinclass-checkpoint.ipynb │ ├── Circle_Area_import-checkpoint.ipynb │ ├── Untitled-checkpoint.ipynb │ ├── python_calisma-checkpoint.ipynb │ ├── tekrar2-checkpoint.ipynb │ └── tekrar3-checkpoint.ipynb ├── 01Temmuzinclass.py.ipynb ├── 02Agustosinclass.ipynb ├── 02Eylulinclass.ipynb ├── 05Agulambdapreclass.ipynb ├── 05Agustosinclass.ipynb ├── 08Temmuzinclass.ipynb ├── 09Agustosinclass.ipynb ├── 09Eylülinclass.ipynb ├── 12Agustosinclass.ipynb ├── 12Temmuzinclass.ipynb ├── 15Temmuzinclass.ipynb ├── 16Agustospreclass.ipynb ├── 18Agustosinclass.ipynb ├── 19Agustosinclass.ipynb ├── 24Haziraninclass.ipynb ├── 26Temmuzinclass.ipynb ├── 28Hazinclass.py.ipynb ├── 29Temmuzinclass.ipynb ├── 30Agustosinclass.ipynb ├── Built_in_functions.ipynb ├── Circle_Area_import.ipynb ├── Module_creating and calling Mehmet.ipynb ├── Untitled.ipynb ├── ZIP_METOT.ipynb ├── benim_ilk_dosyam.txt ├── circle.py ├── fishes.txt ├── fruits.csv ├── fruits.txt ├── fruits2.txt ├── fruits3.txt ├── istiklal.txt ├── preclass.ipynb ├── preclass11Temmuz.ipynb ├── python_calisma.ipynb ├── rumi.txt ├── tekrar1.ipynb ├── tekrar2.ipynb ├── tekrar3.ipynb └── upper_package │ ├── __init__.py │ ├── __pycache__ │ └── __init__.cpython-38.pyc │ ├── my_package_1 │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-38.pyc │ │ ├── circle.cpython-38.pyc │ │ ├── my_module_1.cpython-38.pyc │ │ └── my_module_2.cpython-38.pyc │ ├── circle.py │ ├── my_module_1.py │ └── my_module_2.py │ └── my_package_2 │ ├── __init__.py │ ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── my_module_3.cpython-38.pyc │ └── my_module_4.cpython-38.pyc │ ├── my_module_3.py │ └── my_module_4.py ├── Python-Projects ├── Built_in_functions.ipynb ├── Computational_Thinking_python_calismasi.ipynb ├── Sayilar_calismam.ipynb ├── calisma13.06.2021.ipynb ├── calisma14.06.2021.ipynb ├── calisma15.06.2021.ipynb ├── calisma17.06 2021.ipynb ├── calisma_ders-1.ipynb ├── collections_calismasi.ipynb ├── kelime_calismam.ipynb ├── mentor_addicts.ipynb ├── preclass_24.06.2021_list.py.ipynb ├── python_calismasi.ipynb ├── python_sadik .ipynb ├── raife_hoca_task2.ipynb ├── raife_hoca_task2_dönüt.ipynb └── raife_hoca_task_calismasi (1).ipynb ├── Python-Workshops ├── .ipynb_checkpoints │ ├── Code_Challenge(Missing_chart, Front_back)-checkpoint.ipynb │ ├── Edward Mentor_24_August Python_Answer_And_Solutions-checkpoint.ipynb │ ├── Number_Place_Value 09.08-checkpoint.ipynb │ ├── Perfect_Number_1-500Challenge-checkpoint.ipynb │ ├── Prime_Number_Factors 09.08-checkpoint.ipynb │ ├── Teamwork_8_Calismasi-checkpoint.ipynb │ ├── mehmet workshop-checkpoint.ipynb │ ├── mehmet_hoca_workshop-checkpoint.ipynb │ ├── python_workshop_3(student)-checkpoint.ipynb │ ├── raife_hoca_task3-checkpoint.ipynb │ ├── raife_hoca_task33-checkpoint.ipynb │ ├── raife_hoca_task_2_dönüt-checkpoint.ipynb │ ├── raife_hoca_task_4-checkpoint.ipynb │ ├── teamwork9-checkpoint.ipynb │ ├── teamwork_11-checkpoint.ipynb │ └── workshop-4(student)-checkpoint.ipynb ├── 13.08.21_Clarusway_Soru_Cözüm.py ├── Code_Challenge(Missing_chart, Front_back).ipynb ├── Edward Mentor_24_August Python_Answer_And_Solutions.ipynb ├── Soru_Cozumu_27_Aug_2021.ipynb ├── Soru_Cozumu_27_Aug_2021_Sorular_Cozumler.ipynb ├── Teamwork_8_Calismasi.ipynb ├── Workshop1_20.06.2021.ipynb ├── Workshop2_29.06.2021.ipynb ├── Workshop_Jason.ipynb ├── edabit_soru_çözümü.ipynb ├── group_1_cozumlu.ipynb ├── mehmet_hoca_workshop.ipynb ├── python_workshop_3(lead).ipynb ├── python_workshop_3_10.08.2021.ipynb ├── raife_hoca_task3.ipynb ├── raife_hoca_task33.ipynb ├── raife_hoca_task_1.ipynb ├── raife_hoca_task_2_dönüt.ipynb ├── raife_hoca_task_4.ipynb ├── teamwork9.ipynb ├── teamwork_11.ipynb └── workshop-4(student).ipynb └── README.md /Python-Addicts/'One_Owt_Three_Ruof _Five_Xis_Seven' .ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "c7b0133b", 6 | "metadata": {}, 7 | "source": [ 8 | "Write your solution:\n", 9 | "* Output: 'one owt three ruof five xis seven' \n", 10 | "* Input: 'one two three four five six seven'" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "2c858ca3", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "def modify(text):\n", 21 | "\n", 22 | " text = text.split()\n", 23 | " for i in range(1, len(text), 2):\n", 24 | " text[i] = \"\".join(reversed(text[i]))\n", 25 | " return \" \".join(text)\n", 26 | "\n", 27 | "modify('one two three four five six seven')" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "id": "2f65a0d6", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "def bi_düz_bi_ters(aaa):\n", 38 | " liste = aaa.split()\n", 39 | " new = \"\"\n", 40 | " for i in range(len(liste)):\n", 41 | " if i % 2:\n", 42 | " new += (liste[i])[::-1] + \" \"\n", 43 | " else:\n", 44 | " new += liste[i] + \" \"\n", 45 | " return new.rstrip()\n", 46 | "bi_düz_bi_ters(\"one two three four five six seven\")" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 1, 52 | "id": "be3a00ae", 53 | "metadata": {}, 54 | "outputs": [ 55 | { 56 | "data": { 57 | "text/plain": [ 58 | "['one', 'two', 'three', 'four', 'five', 'six', 'seven']" 59 | ] 60 | }, 61 | "execution_count": 1, 62 | "metadata": {}, 63 | "output_type": "execute_result" 64 | } 65 | ], 66 | "source": [ 67 | "def kelime(n):\n", 68 | " x=dict(enumerate(n.split()))\n", 69 | " return [x.get(i)[::-1] if i%2==1 else x.get(i) for i in x]\n", 70 | "kelime('one owt three ruof five xis seven' )" 71 | ] 72 | } 73 | ], 74 | "metadata": { 75 | "kernelspec": { 76 | "display_name": "Python 3", 77 | "language": "python", 78 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 79 | }, 80 | "language_info": { 81 | "codemirror_mode": { 82 | "name": "ipython", 83 | "version": 3 84 | }, 85 | "file_extension": ".py", 86 | "mimetype": "text/x-python", 87 | "name": "python", 88 | "nbconvert_exporter": "python", 89 | "pygments_lexer": "ipython3", 90 | "version": "3.9.7" 91 | } 92 | }, 93 | "nbformat": 4, 94 | "nbformat_minor": 5 95 | } 96 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/'One_Owt_Three_Ruof _Five_Xis_Seven' -checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "c7b0133b", 6 | "metadata": {}, 7 | "source": [ 8 | "Write your solution:\n", 9 | "* Output: 'one owt three ruof five xis seven' \n", 10 | "* Input: 'one two three four five six seven'" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "2c858ca3", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "def modify(text):\n", 21 | "\n", 22 | " text = text.split()\n", 23 | " for i in range(1, len(text), 2):\n", 24 | " text[i] = \"\".join(reversed(text[i]))\n", 25 | " return \" \".join(text)\n", 26 | "\n", 27 | "modify('one two three four five six seven')" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "id": "2f65a0d6", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "def bi_düz_bi_ters(aaa):\n", 38 | " liste = aaa.split()\n", 39 | " new = \"\"\n", 40 | " for i in range(len(liste)):\n", 41 | " if i % 2:\n", 42 | " new += (liste[i])[::-1] + \" \"\n", 43 | " else:\n", 44 | " new += liste[i] + \" \"\n", 45 | " return new.rstrip()\n", 46 | "bi_düz_bi_ters(\"one two three four five six seven\")" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 1, 52 | "id": "be3a00ae", 53 | "metadata": {}, 54 | "outputs": [ 55 | { 56 | "data": { 57 | "text/plain": [ 58 | "['one', 'two', 'three', 'four', 'five', 'six', 'seven']" 59 | ] 60 | }, 61 | "execution_count": 1, 62 | "metadata": {}, 63 | "output_type": "execute_result" 64 | } 65 | ], 66 | "source": [ 67 | "def kelime(n):\n", 68 | " x=dict(enumerate(n.split()))\n", 69 | " return [x.get(i)[::-1] if i%2==1 else x.get(i) for i in x]\n", 70 | "kelime('one owt three ruof five xis seven' )" 71 | ] 72 | } 73 | ], 74 | "metadata": { 75 | "kernelspec": { 76 | "display_name": "Python 3", 77 | "language": "python", 78 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 79 | }, 80 | "language_info": { 81 | "codemirror_mode": { 82 | "name": "ipython", 83 | "version": 3 84 | }, 85 | "file_extension": ".py", 86 | "mimetype": "text/x-python", 87 | "name": "python", 88 | "nbconvert_exporter": "python", 89 | "pygments_lexer": "ipython3", 90 | "version": "3.9.7" 91 | } 92 | }, 93 | "nbformat": 4, 94 | "nbformat_minor": 5 95 | } 96 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Accumulating_List-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "caf37ffa", 6 | "metadata": {}, 7 | "source": [ 8 | "accumulating_list([1, 2, 3, 4]) ➞ [1, 3, 6, 10]\n", 9 | " [1, 3, 6, 10] can be written as [1, 1 + 2, 1 + 2 + 3, 1 + 2 + 3 + 4]\n", 10 | "\n", 11 | "accumulating_list([1, 5, 7]) ➞ [1, 6, 13]\n", 12 | "\n", 13 | "accumulating_list([1, 0, 1, 0, 1]) ➞ [1, 1, 2, 2, 3]\n", 14 | "\n", 15 | "accumulating_list([]) ➞ []" 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": null, 21 | "id": "4efe7f87", 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "def accumulating_list(list1):\n", 26 | " return [sum(list1[:i+1]) for i in range(len(list1))]" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "id": "146a9c3a", 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "def accumulating_list(lst):\n", 37 | "\treturn [\n", 38 | "\t\tsum(lst[:num])\n", 39 | "\t\tfor num in range(1, len(lst) + 1)\n", 40 | "\t]" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "40c5c31a", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "def accumulating_list(lst):\n", 51 | " sum=0\n", 52 | " sum_list=[]\n", 53 | " for a in lst:\n", 54 | " sum+=a\n", 55 | " sum_list.append(sum)\n", 56 | " return sum_list" 57 | ] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "id": "e26e7f15", 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "109b32b5", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | } 75 | ], 76 | "metadata": { 77 | "kernelspec": { 78 | "display_name": "Python 3", 79 | "language": "python", 80 | "name": "python3" 81 | }, 82 | "language_info": { 83 | "codemirror_mode": { 84 | "name": "ipython", 85 | "version": 3 86 | }, 87 | "file_extension": ".py", 88 | "mimetype": "text/x-python", 89 | "name": "python", 90 | "nbconvert_exporter": "python", 91 | "pygments_lexer": "ipython3", 92 | "version": "3.8.8" 93 | } 94 | }, 95 | "nbformat": 4, 96 | "nbformat_minor": 5 97 | } 98 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Add_Dots Functions-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "bd2d5414", 6 | "metadata": {}, 7 | "source": [ 8 | "- Write a function named add_dots that takes a string and adds \".\" in between each letter.\n", 9 | "- For example\n", 10 | "- calling add_dots(\"test\") should return the string \"t.e.s.t\".\n", 11 | "- Then, below the add_dots function,\n", 12 | "- write another function named remove_dots that removes all dots from a string.\n", 13 | "- For example\n", 14 | "- calling remove_dots(\"t.e.s.t\") should return \"test\".\n", 15 | "- If both functions are correct,\n", 16 | "- calling remove_dots(add_dots(string)) should return back the original string for any string." 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": null, 22 | "id": "6e63ff89", 23 | "metadata": {}, 24 | "outputs": [], 25 | "source": [ 26 | "def add_dots(string):\n", 27 | " return \".\".join(string)\n", 28 | "\n", 29 | "def remove_dots(string):\n", 30 | " return string.replace(\".\", \"\")\n", 31 | "\n", 32 | "remove_dots(add_dots(\"altay\"))" 33 | ] 34 | } 35 | ], 36 | "metadata": { 37 | "kernelspec": { 38 | "display_name": "Python 3", 39 | "language": "python", 40 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 41 | }, 42 | "language_info": { 43 | "codemirror_mode": { 44 | "name": "ipython", 45 | "version": 3 46 | }, 47 | "file_extension": ".py", 48 | "mimetype": "text/x-python", 49 | "name": "python", 50 | "nbconvert_exporter": "python", 51 | "pygments_lexer": "ipython3", 52 | "version": "3.9.7" 53 | } 54 | }, 55 | "nbformat": 4, 56 | "nbformat_minor": 5 57 | } 58 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Ara_toplam_haric-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "36bdf9b3", 6 | "metadata": {}, 7 | "source": [ 8 | "Bir fonksiyon yazınız; Fonksiyonunuz, kullanıcıdan 2 sayı istesin ve \n", 9 | "kullanıcıdan girilen sayılar arasındaki sayıların toplamını çıktı olarak versin. \n", 10 | "Kullanıcıdan alınan sayılar toplama dahil edilmesin. Herkese kolay gelsin. \n", 11 | "\n", 12 | "For Example:\n", 13 | "Input (5, 12)\n", 14 | "Output (41)" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 14, 20 | "id": "c8e23053", 21 | "metadata": {}, 22 | "outputs": [ 23 | { 24 | "data": { 25 | "text/plain": [ 26 | "51" 27 | ] 28 | }, 29 | "execution_count": 14, 30 | "metadata": {}, 31 | "output_type": "execute_result" 32 | } 33 | ], 34 | "source": [ 35 | "def ara_toplam(a,b):\n", 36 | " toplam=0\n", 37 | " for i in range(a+1, b):\n", 38 | " toplam+=i\n", 39 | " return toplam\n", 40 | "\n", 41 | "ara_toplam(5,12)\n" 42 | ] 43 | }, 44 | { 45 | "cell_type": "markdown", 46 | "id": "61f003f2", 47 | "metadata": {}, 48 | "source": [ 49 | "Create a function that takes two numbers as arguments and return their sum.\n", 50 | "Examples\n", 51 | "addition(3, 2) ➞ 5\n", 52 | "addition(-3, -6) ➞ -9\n", 53 | "addition(7, 3) ➞ 10" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 2, 59 | "id": "6577aadb", 60 | "metadata": {}, 61 | "outputs": [ 62 | { 63 | "data": { 64 | "text/plain": [ 65 | "-9" 66 | ] 67 | }, 68 | "execution_count": 2, 69 | "metadata": {}, 70 | "output_type": "execute_result" 71 | } 72 | ], 73 | "source": [ 74 | "def addition(x, y):\n", 75 | " return x+y\n", 76 | "addition(-3, -6)" 77 | ] 78 | } 79 | ], 80 | "metadata": { 81 | "kernelspec": { 82 | "display_name": "Python 3", 83 | "language": "python", 84 | "name": "python3" 85 | }, 86 | "language_info": { 87 | "codemirror_mode": { 88 | "name": "ipython", 89 | "version": 3 90 | }, 91 | "file_extension": ".py", 92 | "mimetype": "text/x-python", 93 | "name": "python", 94 | "nbconvert_exporter": "python", 95 | "pygments_lexer": "ipython3", 96 | "version": "3.8.8" 97 | } 98 | }, 99 | "nbformat": 4, 100 | "nbformat_minor": 5 101 | } 102 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Artan_düzende_sıralanmış_liste-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "13c7d8bb", 6 | "metadata": {}, 7 | "source": [ 8 | "Verilen bir boş olmayan demetler listesinden her bir demetteki son elemana göre \n", 9 | "artan düzende sıralanmış bir liste elde etmek için bir Python programı yazın.\n", 10 | "Örnek Liste : [(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]\n", 11 | "Beklenen Sonuç : [(2, 1), (1 , 2), (2, 3), (4, 4), (2, 5)]" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 6, 17 | "id": "96329534", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "[(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)]\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "liste = [(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]\n", 30 | "new = []\n", 31 | "newest = []\n", 32 | "for k, v in liste:\n", 33 | " new.append((v, k))\n", 34 | "new.sort()\n", 35 | "for k, v in new:\n", 36 | " newest.append((v, k))\n", 37 | "print(newest)" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": 3, 43 | "id": "34d8f745", 44 | "metadata": {}, 45 | "outputs": [ 46 | { 47 | "name": "stdout", 48 | "output_type": "stream", 49 | "text": [ 50 | "[(5, 2), (2, 1), (4, 4), (3, 2), (1, 2)]\n", 51 | "[(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)]\n" 52 | ] 53 | } 54 | ], 55 | "source": [ 56 | "a=[(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]\n", 57 | "#print([j[::-1] for j in sorted([i[::-1] for i in a])])\n", 58 | "b=[]\n", 59 | "c=[]\n", 60 | "for i in a:\n", 61 | " b.append(i[::-1])\n", 62 | "print(b)\n", 63 | "for i in sorted(b):\n", 64 | " c.append(i[::-1])\n", 65 | "print(c)" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "id": "3d8e1668", 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [] 75 | } 76 | ], 77 | "metadata": { 78 | "kernelspec": { 79 | "display_name": "Python 3", 80 | "language": "python", 81 | "name": "python3" 82 | }, 83 | "language_info": { 84 | "codemirror_mode": { 85 | "name": "ipython", 86 | "version": 3 87 | }, 88 | "file_extension": ".py", 89 | "mimetype": "text/x-python", 90 | "name": "python", 91 | "nbconvert_exporter": "python", 92 | "pygments_lexer": "ipython3", 93 | "version": "3.8.8" 94 | } 95 | }, 96 | "nbformat": 4, 97 | "nbformat_minor": 5 98 | } 99 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Brackets_Balance_Testi -checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Comfortable_words-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Comma_Separated_Sequence-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "5f419af5", 6 | "metadata": {}, 7 | "source": [ 8 | "Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically.\n", 9 | "Suppose the following input is supplied to the program:\n", 10 | "without,hello,bag,world\n", 11 | "Then, the output should be:\n", 12 | "bag,hello,without,world" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": null, 18 | "id": "f09dc67c", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "def comma(string):\n", 23 | " liste = string.split(\",\")\n", 24 | " liste1 = []\n", 25 | " for i in liste:\n", 26 | " liste1.append(i.lower())\n", 27 | " return sorted(liste1)\n", 28 | "comma(\"steive,dustin,Bean,Enzo,murat,adsum,muhammet,burak\")" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 1, 34 | "id": "0a638f6a", 35 | "metadata": {}, 36 | "outputs": [ 37 | { 38 | "data": { 39 | "text/plain": [ 40 | "['adsum', 'bean', 'burak', 'dustin', 'enzo', 'muhammet', 'murat', 'steive']" 41 | ] 42 | }, 43 | "execution_count": 1, 44 | "metadata": {}, 45 | "output_type": "execute_result" 46 | } 47 | ], 48 | "source": [ 49 | "def ayir(words):\n", 50 | " return sorted([i.lower() for i in words.split(\",\")])\n", 51 | "ayir(\"steive,dustin,Bean,Enzo,murat,adsum,muhammet,burak\")" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": null, 57 | "id": "10955ff5", 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [] 61 | } 62 | ], 63 | "metadata": { 64 | "kernelspec": { 65 | "display_name": "Python 3", 66 | "language": "python", 67 | "name": "python3" 68 | }, 69 | "language_info": { 70 | "codemirror_mode": { 71 | "name": "ipython", 72 | "version": 3 73 | }, 74 | "file_extension": ".py", 75 | "mimetype": "text/x-python", 76 | "name": "python", 77 | "nbconvert_exporter": "python", 78 | "pygments_lexer": "ipython3", 79 | "version": "3.8.8" 80 | } 81 | }, 82 | "nbformat": 4, 83 | "nbformat_minor": 5 84 | } 85 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Datetime_Modülü-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0dc15742", 6 | "metadata": {}, 7 | "source": [ 8 | "Use datetime modul and create a file . Output : \" Python 02-09-2021.txt \"\n" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "5149544e", 15 | "metadata": {}, 16 | "outputs": [ 17 | { 18 | "name": "stdout", 19 | "output_type": "stream", 20 | "text": [ 21 | "created 19-09-2021.txt\n" 22 | ] 23 | } 24 | ], 25 | "source": [ 26 | "from datetime import datetime\n", 27 | "x= datetime.now()\n", 28 | "file_name = x.strftime('%d-%m-%Y.txt')\n", 29 | "with open(file_name, 'w') as fp:\n", 30 | " print('created', file_name)" 31 | ] 32 | } 33 | ], 34 | "metadata": { 35 | "kernelspec": { 36 | "display_name": "Python 3", 37 | "language": "python", 38 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 39 | }, 40 | "language_info": { 41 | "codemirror_mode": { 42 | "name": "ipython", 43 | "version": 3 44 | }, 45 | "file_extension": ".py", 46 | "mimetype": "text/x-python", 47 | "name": "python", 48 | "nbconvert_exporter": "python", 49 | "pygments_lexer": "ipython3", 50 | "version": "3.9.7" 51 | } 52 | }, 53 | "nbformat": 4, 54 | "nbformat_minor": 5 55 | } 56 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Disarium Number-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Havuz_Dolum_Challenge-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Index_of_Caps_Letter-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "7ee116c4", 6 | "metadata": {}, 7 | "source": [ 8 | "Create a function that takes a single string as argument and returns an ordered list containing the indices of all capital letters in the string.\n", 9 | "\n", 10 | "Examples\n", 11 | "index_of_caps(\"eDaBiT\") ➞ [1, 3, 5]\n", 12 | "\n", 13 | "index_of_caps(\"eQuINoX\") ➞ [1, 3, 4, 6]\n", 14 | "\n", 15 | "index_of_caps(\"determine\") ➞ []\n", 16 | "\n", 17 | "index_of_caps(\"STRIKE\") ➞ [0, 1, 2, 3, 4, 5]\n", 18 | "\n", 19 | "index_of_caps(\"sUn\") ➞ [1]\n", 20 | "Notes\n", 21 | "Return an empty list if no uppercase letters are found in the string.\n", 22 | "Special characters ($#@%) and numbers will be included in some test cases.\n", 23 | "Assume all words do not have duplicate letters." 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "id": "9f037213", 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "def index_of_caps(word):\n", 34 | "\tresult = []\n", 35 | "\tfor i in word:\n", 36 | "\t\tif i.isupper():\n", 37 | "\t\t\tresult.append(word.index(i))\n", 38 | "\treturn result" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "id": "cedc1b1a", 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "def index_of_caps(word):\n", 49 | "\treturn [word.index(i) for i in word if i.isupper()]" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": null, 55 | "id": "d1310292", 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "def index_of_caps(word):\n", 60 | " return [i for i in range(len(word)) if word[i].isupper()]" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "d187b553", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "def index_of_caps(word):\n", 71 | " return [i for i in range(len(word)) if word[i].isupper()]" 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "execution_count": null, 77 | "id": "b1caa3c0", 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [] 81 | } 82 | ], 83 | "metadata": { 84 | "kernelspec": { 85 | "display_name": "Python 3", 86 | "language": "python", 87 | "name": "python3" 88 | }, 89 | "language_info": { 90 | "codemirror_mode": { 91 | "name": "ipython", 92 | "version": 3 93 | }, 94 | "file_extension": ".py", 95 | "mimetype": "text/x-python", 96 | "name": "python", 97 | "nbconvert_exporter": "python", 98 | "pygments_lexer": "ipython3", 99 | "version": "3.8.8" 100 | } 101 | }, 102 | "nbformat": 4, 103 | "nbformat_minor": 5 104 | } 105 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Lesteden_Eleman_Cikarma-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "91df78b6", 6 | "metadata": {}, 7 | "source": [ 8 | "0., 4. ve 5. elemanları çıkardıktan sonra belirtilen listeyi yazdıracak bir Python programı yazın. \n", 9 | "Örnek Liste : ['Kırmızı', 'Yeşil', 'Beyaz', 'Siyah', 'Pembe', 'Sarı']\n", 10 | "Beklenen Çıktı : ['Yeşil', 'Beyaz', 'Siyah']\n", 11 | "Not: 3 satırda yapın." 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 1, 17 | "id": "65cf91a4", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "['Yeşil', 'Beyaz', 'Siyah']\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "liste = ['Kırmızı', 'Yeşil', 'Beyaz', 'Siyah', 'Pembe', 'Sarı']\n", 30 | "a = list(filter(lambda x : x == liste[1] or x == liste[2] or x == liste[3], liste))\n", 31 | "print(a)" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 2, 37 | "id": "9f0affd0", 38 | "metadata": {}, 39 | "outputs": [ 40 | { 41 | "data": { 42 | "text/plain": [ 43 | "['Yeşil', 'Beyaz', 'Siyah']" 44 | ] 45 | }, 46 | "execution_count": 2, 47 | "metadata": {}, 48 | "output_type": "execute_result" 49 | } 50 | ], 51 | "source": [ 52 | "def cıkar(lstx):\n", 53 | " new_lst =[]\n", 54 | " k = 0\n", 55 | " while k < len(lstx):\n", 56 | " if k != 0 and k != 4 and k != 5:\n", 57 | " new_lst.append(lstx[k])\n", 58 | " k += 1\n", 59 | " return new_lst\n", 60 | "\n", 61 | "cıkar(['Kırmızı', 'Yeşil', 'Beyaz', 'Siyah', 'Pembe', 'Sarı'])" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "c109a9f8", 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [] 71 | } 72 | ], 73 | "metadata": { 74 | "kernelspec": { 75 | "display_name": "Python 3", 76 | "language": "python", 77 | "name": "python3" 78 | }, 79 | "language_info": { 80 | "codemirror_mode": { 81 | "name": "ipython", 82 | "version": 3 83 | }, 84 | "file_extension": ".py", 85 | "mimetype": "text/x-python", 86 | "name": "python", 87 | "nbconvert_exporter": "python", 88 | "pygments_lexer": "ipython3", 89 | "version": "3.8.8" 90 | } 91 | }, 92 | "nbformat": 4, 93 | "nbformat_minor": 5 94 | } 95 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Lexicographical_Order-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "1afdc210", 6 | "metadata": {}, 7 | "source": [ 8 | "1- Given two arrays of strings a1 and a2 return a sorted array r in lexicographical order of the strings of a1 which are substrings of strings of a2.\n", 9 | "\n", 10 | "Example 1: a1 = [\"arp\", \"live\", \"strong\"]\n", 11 | "\n", 12 | "a2 = [\"lively\", \"alive\", \"harp\", \"sharp\", \"armstrong\"]\n", 13 | "\n", 14 | "returns [\"arp\", \"live\", \"strong\"]\n", 15 | "\n", 16 | "Example 2: a1 = [\"tarp\", \"mice\", \"bull\"]\n", 17 | "\n", 18 | "a2 = [\"lively\", \"alive\", \"harp\", \"sharp\", \"armstrong\"]\n", 19 | "\n", 20 | "returns []\n", 21 | "\n", 22 | "Notes: Arrays are written in \"general\" notation. See \"Your Test Cases\" for examples in your language.\n", 23 | "\n", 24 | "In Shell bash a1 and a2 are strings. The return is a string where words are separated by commas." 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": null, 30 | "id": "9b73ac89", 31 | "metadata": {}, 32 | "outputs": [], 33 | "source": [ 34 | "a1 = [\"arp\", \"live\", \"strong\"]\n", 35 | "a2 = [\"lively\", \"alive\", \"harp\", \"sharp\", \"armstrong\"]\n", 36 | "lst = []\n", 37 | "for i in a1:\n", 38 | " for j in a2:\n", 39 | " if i in j and i not in lst:\n", 40 | " lst.append(i)\n", 41 | "print(lst) " 42 | ] 43 | } 44 | ], 45 | "metadata": { 46 | "kernelspec": { 47 | "display_name": "Python 3", 48 | "language": "python", 49 | "name": "python3" 50 | }, 51 | "language_info": { 52 | "codemirror_mode": { 53 | "name": "ipython", 54 | "version": 3 55 | }, 56 | "file_extension": ".py", 57 | "mimetype": "text/x-python", 58 | "name": "python", 59 | "nbconvert_exporter": "python", 60 | "pygments_lexer": "ipython3", 61 | "version": "3.8.8" 62 | } 63 | }, 64 | "nbformat": 4, 65 | "nbformat_minor": 5 66 | } 67 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/List_Target_Challenge-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/List_of_Tuples-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "7f0fc66d", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "[('z', 0), ('b', 1), ('c', 2), ('x', 3), ('x', 4)]\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "liste = [('b', 1), ('c', 2), ('x', 3), ('x', 4), ('z', 0)]\n", 19 | "liste = sorted([i[::-1] for i in liste])\n", 20 | "liste = [i[::-1] for i in liste]\n", 21 | "print(liste)" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 1, 27 | "id": "bf2206c8", 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "name": "stdout", 32 | "output_type": "stream", 33 | "text": [ 34 | "[('z', 0), ('b', 1), ('c', 2), ('x', 3), ('x', 4)]\n" 35 | ] 36 | } 37 | ], 38 | "source": [ 39 | "input=[(\"b\",1),(\"c\",2),(\"x\",3),(\"x\",4),(\"z\",0)]\n", 40 | "dicct={i:j for j,i in input}\n", 41 | "output=[(dicct[k],k) for k in sorted(dicct.keys())]\n", 42 | "print(output)" 43 | ] 44 | } 45 | ], 46 | "metadata": { 47 | "kernelspec": { 48 | "display_name": "Python 3", 49 | "language": "python", 50 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 51 | }, 52 | "language_info": { 53 | "codemirror_mode": { 54 | "name": "ipython", 55 | "version": 3 56 | }, 57 | "file_extension": ".py", 58 | "mimetype": "text/x-python", 59 | "name": "python", 60 | "nbconvert_exporter": "python", 61 | "pygments_lexer": "ipython3", 62 | "version": "3.9.7" 63 | } 64 | }, 65 | "nbformat": 4, 66 | "nbformat_minor": 5 67 | } 68 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Listeyi_Tersten_Yazdirma-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Longest_Alternating_Substring-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "f1463afc", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Given a string of digits, return the longest substring with alternating \n", 11 | "odd/even or even/odd digits. If two or more substrings have the same length, \n", 12 | "return the substring that occurs first.\n", 13 | "\n", 14 | "Examples\n", 15 | "longest_substring(\"225424272163254474441338664823\") ➞ \"272163254\"\n", 16 | "# substrings = 254, 272163254, 474, 41, 38, 23\n", 17 | "\n", 18 | "longest_substring(\"594127169973391692147228678476\") ➞ \"16921472\"\n", 19 | "# substrings = 94127, 169, 16921472, 678, 476\n", 20 | "\n", 21 | "longest_substring(\"721449827599186159274227324466\") ➞ \"7214\"\n", 22 | "# substrings = 7214, 498, 27, 18, 61, 9274, 27, 32\n", 23 | "# 7214 and 9274 have same length, but 7214 occurs first." 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "id": "12472b91", 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "id": "22279a0d", 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "ec8b7057", 46 | "metadata": {}, 47 | "outputs": [], 48 | "source": [] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": null, 53 | "id": "84af41f5", 54 | "metadata": {}, 55 | "outputs": [], 56 | "source": [] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "id": "9349af1c", 62 | "metadata": {}, 63 | "outputs": [], 64 | "source": [] 65 | } 66 | ], 67 | "metadata": { 68 | "kernelspec": { 69 | "display_name": "Python 3", 70 | "language": "python", 71 | "name": "python3" 72 | }, 73 | "language_info": { 74 | "codemirror_mode": { 75 | "name": "ipython", 76 | "version": 3 77 | }, 78 | "file_extension": ".py", 79 | "mimetype": "text/x-python", 80 | "name": "python", 81 | "nbconvert_exporter": "python", 82 | "pygments_lexer": "ipython3", 83 | "version": "3.8.8" 84 | } 85 | }, 86 | "nbformat": 4, 87 | "nbformat_minor": 5 88 | } 89 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Main_Number-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "44f311ef", 6 | "metadata": {}, 7 | "source": [ 8 | "The main number is 7.\n", 9 | "7 - 7 = 0\n", 10 | "7 - 8 = 1\n", 11 | "7 - 9 = 2\n", 12 | "The main number is 8.\n", 13 | "8 - 7 = 1\n", 14 | "8 - 8 = 0\n", 15 | "8 - 9 = 1\n", 16 | "The main number is 9.\n", 17 | "9 - 7 = 2\n", 18 | "9 - 8 = 1\n", 19 | "9 - 9 = 0" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "49ba343b", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "def main_number(n): \n", 30 | " a = n\n", 31 | " while n <= 9:\n", 32 | " y = a\n", 33 | " print(f'The main number is {n}.')\n", 34 | " while y <= 9:\n", 35 | " if n - y < 0:\n", 36 | " print(f'{n} - {y} = {-(n-y)}')\n", 37 | " else:\n", 38 | " print(f'{n} - {y} = {(n-y)}')\n", 39 | " y += 1\n", 40 | " n += 1\n", 41 | "\n", 42 | "main_number(5)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "id": "b6607c62", 49 | "metadata": {}, 50 | "outputs": [], 51 | "source": [ 52 | "def main_number(n): \n", 53 | " a = n\n", 54 | " while n <= 9:\n", 55 | " y = a\n", 56 | " print(f'The main number is {n}.')\n", 57 | " while y <= 9:\n", 58 | " print(f'{n} - {y} = {abs(n-y)}')\n", 59 | " y += 1\n", 60 | " n += 1\n", 61 | "main_number(5)" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "6ef466d3", 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [] 71 | }, 72 | { 73 | "cell_type": "code", 74 | "execution_count": null, 75 | "id": "62c5e53e", 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [] 79 | } 80 | ], 81 | "metadata": { 82 | "kernelspec": { 83 | "display_name": "Python 3", 84 | "language": "python", 85 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 86 | }, 87 | "language_info": { 88 | "codemirror_mode": { 89 | "name": "ipython", 90 | "version": 3 91 | }, 92 | "file_extension": ".py", 93 | "mimetype": "text/x-python", 94 | "name": "python", 95 | "nbconvert_exporter": "python", 96 | "pygments_lexer": "ipython3", 97 | "version": "3.9.7" 98 | } 99 | }, 100 | "nbformat": 4, 101 | "nbformat_minor": 5 102 | } 103 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Matriksler_challenge-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "7ab8c979", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "lst = [1,2,3]\n", 19 | "lst_new = []\n", 20 | "for i in lst:\n", 21 | " for j in lst:\n", 22 | " for k in lst:\n", 23 | " if i != j and j != k and i != k:\n", 24 | " lst_new.append([i,j,k])\n", 25 | "print(lst_new)\n" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 2, 31 | "id": "87d80bb2", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "name": "stdout", 36 | "output_type": "stream", 37 | "text": [ 38 | "[[1, 2, 3], [2, 3, 1], [3, 1, 2], [1, 2, 3], [2, 3, 1], [3, 1, 2]]\n" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "list1 = [1, 2, 3]\n", 44 | "i = 1\n", 45 | "fact = 1\n", 46 | "while i < len(list1) + 1 :\n", 47 | " fact *= i\n", 48 | " i += 1\n", 49 | "i = 1\n", 50 | "fact_dict = {}\n", 51 | "while i < fact + 1:\n", 52 | " fact_dict[i] = []\n", 53 | " i += 1\n", 54 | "\n", 55 | "indx= 0 \n", 56 | "for i in range(len(list1)):\n", 57 | " for k in range(1, fact+1):\n", 58 | " fact_dict[k].append(list1[indx])\n", 59 | " indx += 1\n", 60 | " if indx == len(list1):\n", 61 | " indx = 0\n", 62 | " indx += 1 \n", 63 | " \n", 64 | "print(list(fact_dict.values()))" 65 | ] 66 | } 67 | ], 68 | "metadata": { 69 | "kernelspec": { 70 | "display_name": "Python 3", 71 | "language": "python", 72 | "name": "python3" 73 | }, 74 | "language_info": { 75 | "codemirror_mode": { 76 | "name": "ipython", 77 | "version": 3 78 | }, 79 | "file_extension": ".py", 80 | "mimetype": "text/x-python", 81 | "name": "python", 82 | "nbconvert_exporter": "python", 83 | "pygments_lexer": "ipython3", 84 | "version": "3.8.8" 85 | } 86 | }, 87 | "nbformat": 4, 88 | "nbformat_minor": 5 89 | } 90 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Max_of_three_numbers-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "efebf6ba", 6 | "metadata": {}, 7 | "source": [ 8 | "Note: Built-in Functions kullanmayalım\n", 9 | "Write a Python function to find the Max of three numbers." 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "id": "880b3619", 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "liste = []\n", 20 | "while True:\n", 21 | " num = input(\"Enter a number or press 'q' to exit > \")\n", 22 | " if num.lower() == 'q':\n", 23 | " break\n", 24 | " else:\n", 25 | " liste.append(int(num))\n", 26 | " \n", 27 | "def maximum(): \n", 28 | " biggest = liste[0] \n", 29 | " for i in liste:\n", 30 | " if i > biggest:\n", 31 | " biggest = i\n", 32 | " return biggest\n", 33 | " \n", 34 | "maximum()" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 3, 40 | "id": "0bfec946", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "name": "stdout", 45 | "output_type": "stream", 46 | "text": [ 47 | "9\n" 48 | ] 49 | } 50 | ], 51 | "source": [ 52 | "def max_of_three( x, y,z ):\n", 53 | " if x > y and x > z:\n", 54 | " return x\n", 55 | " elif y>x and y> z:\n", 56 | " return y\n", 57 | " return z\n", 58 | "print(max_of_three(3,7,9))" 59 | ] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": 4, 64 | "id": "e6aca484", 65 | "metadata": {}, 66 | "outputs": [ 67 | { 68 | "name": "stdout", 69 | "output_type": "stream", 70 | "text": [ 71 | "25\n" 72 | ] 73 | } 74 | ], 75 | "source": [ 76 | "num_list = [2, 25, -96]\n", 77 | "\n", 78 | "max_num = num_list[0]\n", 79 | "for i in num_list:\n", 80 | " if i > max_num:\n", 81 | " max_num = i\n", 82 | "print(max_num)" 83 | ] 84 | } 85 | ], 86 | "metadata": { 87 | "kernelspec": { 88 | "display_name": "Python 3", 89 | "language": "python", 90 | "name": "python3" 91 | }, 92 | "language_info": { 93 | "codemirror_mode": { 94 | "name": "ipython", 95 | "version": 3 96 | }, 97 | "file_extension": ".py", 98 | "mimetype": "text/x-python", 99 | "name": "python", 100 | "nbconvert_exporter": "python", 101 | "pygments_lexer": "ipython3", 102 | "version": "3.8.8" 103 | } 104 | }, 105 | "nbformat": 4, 106 | "nbformat_minor": 5 107 | } 108 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Name_Age_Height_Tuples -checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "f42061c3", 6 | "metadata": {}, 7 | "source": [ 8 | "You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:\n", 9 | "1: Sort based on name;\n", 10 | "2: Then sort based on age;\n", 11 | "3: Then sort by score.\n", 12 | "The priority is that name > age > score.\n", 13 | "If the following tuples are given as input to the program:\n", 14 | "Tom,19,80\n", 15 | "John,20,90\n", 16 | "Jony,17,91\n", 17 | "Jony,17,93\n", 18 | "Json,21,85\n", 19 | "Then, the output of the program should be:\n", 20 | "[('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Json', '21', '85'), ('Tom', '19', '80')]" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 6, 26 | "id": "6bfaaf96", 27 | "metadata": {}, 28 | "outputs": [ 29 | { 30 | "name": "stdout", 31 | "output_type": "stream", 32 | "text": [ 33 | "[('John', 20, 90), ('Jony', 17, 91), ('Jony', 17, 93), ('Json', 21, 85), ('Tom', 19, 80)]\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "my_tuple = (\"Tom\",19,80), (\"John\",20,90), (\"Jony\",17,91), (\"Jony\",17,93), (\"Json\",21,85)\n", 39 | "sorted_tuple = tuple(sorted(my_tuple, key = lambda item: item[0]))\n", 40 | "print(list(sorted_tuple))" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "7c65df0b", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": null, 54 | "id": "6bcd378b", 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "id": "def9be69", 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "e97f32a9", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | } 75 | ], 76 | "metadata": { 77 | "kernelspec": { 78 | "display_name": "Python 3", 79 | "language": "python", 80 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 81 | }, 82 | "language_info": { 83 | "codemirror_mode": { 84 | "name": "ipython", 85 | "version": 3 86 | }, 87 | "file_extension": ".py", 88 | "mimetype": "text/x-python", 89 | "name": "python", 90 | "nbconvert_exporter": "python", 91 | "pygments_lexer": "ipython3", 92 | "version": "3.9.7" 93 | } 94 | }, 95 | "nbformat": 4, 96 | "nbformat_minor": 5 97 | } 98 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Odd_Position_Even_Position-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Parantheses_InValidTrue-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "61757393", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "x = \"[[{({})}]({}))\"\n", 11 | "\n", 12 | "def isValid(s) :\n", 13 | " while \"()\" in s or \"{}\" in s or \"[]\" in s :\n", 14 | " s = s.replace(\"()\", \"\").replace(\"{}\", \"\").replace(\"[]\", \"\")\n", 15 | " return s == \"\"\n", 16 | "\n", 17 | "isValid(x)" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "19c43fc3", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": null, 31 | "id": "98db3eaa", 32 | "metadata": {}, 33 | "outputs": [], 34 | "source": [] 35 | } 36 | ], 37 | "metadata": { 38 | "kernelspec": { 39 | "display_name": "Python 3", 40 | "language": "python", 41 | "name": "python3" 42 | }, 43 | "language_info": { 44 | "codemirror_mode": { 45 | "name": "ipython", 46 | "version": 3 47 | }, 48 | "file_extension": ".py", 49 | "mimetype": "text/x-python", 50 | "name": "python", 51 | "nbconvert_exporter": "python", 52 | "pygments_lexer": "ipython3", 53 | "version": "3.8.8" 54 | } 55 | }, 56 | "nbformat": 4, 57 | "nbformat_minor": 5 58 | } 59 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Polybius_Square_Basic-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Prime Factors-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "b43d5576", 6 | "metadata": {}, 7 | "source": [ 8 | "Create a function that returns a list containing the \n", 9 | "prime factors of whatever integer is passed to it.\n", 10 | "\n", 11 | "Examples\n", 12 | "prime_factors(20) ➞ [2, 2, 5]\n", 13 | "\n", 14 | "prime_factors(100) ➞ [2, 2, 5, 5]\n", 15 | "\n", 16 | "prime_factors(8912234) ➞ [2, 47, 94811]\n", 17 | "Notes\n", 18 | "Implement your solution using trial division.\n", 19 | "Your solution should not require recursion." 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 2, 25 | "id": "a2660a24", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "def prime_factors(n):\n", 30 | " lst = []\n", 31 | " for i in range(2,n+1):\n", 32 | " if n % i == 0:\n", 33 | " while n % i == 0:\n", 34 | " lst.append(i)\n", 35 | " n = n / i\n", 36 | " return lst" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": 1, 42 | "id": "b23e592d", 43 | "metadata": {}, 44 | "outputs": [ 45 | { 46 | "data": { 47 | "text/plain": [ 48 | "[2, 2, 5, 5]" 49 | ] 50 | }, 51 | "execution_count": 1, 52 | "metadata": {}, 53 | "output_type": "execute_result" 54 | } 55 | ], 56 | "source": [ 57 | "def prime_factors(num):\n", 58 | " lst = []\n", 59 | " while num != 1:\n", 60 | " for i in range(2, num + 1):\n", 61 | " if num % i == 0:\n", 62 | " num //= i\n", 63 | " lst.append(i)\n", 64 | " break\n", 65 | " return lst\n", 66 | "prime_factors(100)" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "id": "8a7db282", 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [] 76 | } 77 | ], 78 | "metadata": { 79 | "kernelspec": { 80 | "display_name": "Python 3", 81 | "language": "python", 82 | "name": "python3" 83 | }, 84 | "language_info": { 85 | "codemirror_mode": { 86 | "name": "ipython", 87 | "version": 3 88 | }, 89 | "file_extension": ".py", 90 | "mimetype": "text/x-python", 91 | "name": "python", 92 | "nbconvert_exporter": "python", 93 | "pygments_lexer": "ipython3", 94 | "version": "3.8.8" 95 | } 96 | }, 97 | "nbformat": 4, 98 | "nbformat_minor": 5 99 | } 100 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Recursion_Function-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "79cc1ae8", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Given a number N. Find Sum of 1 to N. Using Recursion Function.İnput =5 ,Output=15" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 1, 16 | "id": "bb740337", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "15\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "def sum_num(num):\n", 29 | " if num == 1:\n", 30 | " return 1\n", 31 | "\n", 32 | " return num + sum_num(num-1)\n", 33 | "\n", 34 | "print(sum_num(5))" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": null, 40 | "id": "8dc5bd08", 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [] 44 | } 45 | ], 46 | "metadata": { 47 | "kernelspec": { 48 | "display_name": "Python 3", 49 | "language": "python", 50 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 51 | }, 52 | "language_info": { 53 | "codemirror_mode": { 54 | "name": "ipython", 55 | "version": 3 56 | }, 57 | "file_extension": ".py", 58 | "mimetype": "text/x-python", 59 | "name": "python", 60 | "nbconvert_exporter": "python", 61 | "pygments_lexer": "ipython3", 62 | "version": "3.9.7" 63 | } 64 | }, 65 | "nbformat": 4, 66 | "nbformat_minor": 5 67 | } 68 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Remove_Last_Character -checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "56e282da", 6 | "metadata": {}, 7 | "source": [ 8 | "Remove last character in list of strings: given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"] expected output : ['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 2, 14 | "id": "7db68b36", 15 | "metadata": {}, 16 | "outputs": [ 17 | { 18 | "name": "stdout", 19 | "output_type": "stream", 20 | "text": [ 21 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 22 | ] 23 | } 24 | ], 25 | "source": [ 26 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"]\n", 27 | "print(list(map(lambda i:i[:-1],given_list)))" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 4, 33 | "id": "50518b0e", 34 | "metadata": {}, 35 | "outputs": [ 36 | { 37 | "data": { 38 | "text/plain": [ 39 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']" 40 | ] 41 | }, 42 | "execution_count": 4, 43 | "metadata": {}, 44 | "output_type": "execute_result" 45 | } 46 | ], 47 | "source": [ 48 | "def last_char(array):\n", 49 | " return [\"\".join(i[:-1]) for i in array]\n", 50 | "last_char([\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"])" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 5, 56 | "id": "ba9ead44", 57 | "metadata": {}, 58 | "outputs": [ 59 | { 60 | "name": "stdout", 61 | "output_type": "stream", 62 | "text": [ 63 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 64 | ] 65 | } 66 | ], 67 | "source": [ 68 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"]\n", 69 | "a=[i[:-1] for i in given_list]\n", 70 | "print(a)" 71 | ] 72 | } 73 | ], 74 | "metadata": { 75 | "kernelspec": { 76 | "display_name": "Python 3", 77 | "language": "python", 78 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 79 | }, 80 | "language_info": { 81 | "codemirror_mode": { 82 | "name": "ipython", 83 | "version": 3 84 | }, 85 | "file_extension": ".py", 86 | "mimetype": "text/x-python", 87 | "name": "python", 88 | "nbconvert_exporter": "python", 89 | "pygments_lexer": "ipython3", 90 | "version": "3.9.7" 91 | } 92 | }, 93 | "nbformat": 4, 94 | "nbformat_minor": 5 95 | } 96 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Remove_Last_Character-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "e8a61d8f", 6 | "metadata": {}, 7 | "source": [ 8 | "Remove last character in list of strings: \n", 9 | " given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"] \n", 10 | " expected output : ['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 2, 16 | "id": "c60002e2", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"] \n", 29 | "print(list(map(lambda i:i[:-1],given_list)))" 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": 3, 35 | "id": "6a0ca116", 36 | "metadata": {}, 37 | "outputs": [ 38 | { 39 | "name": "stdout", 40 | "output_type": "stream", 41 | "text": [ 42 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 43 | ] 44 | } 45 | ], 46 | "source": [ 47 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"]\n", 48 | "a=[i[:-1] for i in given_list]\n", 49 | "print(a)" 50 | ] 51 | } 52 | ], 53 | "metadata": { 54 | "kernelspec": { 55 | "display_name": "Python 3", 56 | "language": "python", 57 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 58 | }, 59 | "language_info": { 60 | "codemirror_mode": { 61 | "name": "ipython", 62 | "version": 3 63 | }, 64 | "file_extension": ".py", 65 | "mimetype": "text/x-python", 66 | "name": "python", 67 | "nbconvert_exporter": "python", 68 | "pygments_lexer": "ipython3", 69 | "version": "3.9.7" 70 | } 71 | }, 72 | "nbformat": 4, 73 | "nbformat_minor": 5 74 | } 75 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Rotate_Matriks_Challenge-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Square_Pattern-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3a633331", 6 | "metadata": {}, 7 | "source": [ 8 | "Write your solutions. Print square pattern with alphabet symbols: output :\n", 9 | "A A A A A A A \n", 10 | "B B B B B B B \n", 11 | "C C C C C C C \n", 12 | "D D D D D D D \n", 13 | "E E E E E E E \n", 14 | "F F F F F F F \n", 15 | "G G G G G G G " 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": null, 21 | "id": "575c380c", 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "def square_pattern(n, k):\n", 26 | "\n", 27 | " for i in range(ord(n), ord(n)+k):\n", 28 | " for j in range(k):\n", 29 | " print(chr(i), end= \" \")\n", 30 | " print()\n", 31 | "\n", 32 | "square_pattern(\"A\", 7)" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": null, 38 | "id": "5202e431", 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "def kelime(n,k):\n", 43 | " l=\"\"\n", 44 | " t,z=ord(n),0\n", 45 | " while k:\n", 46 | " l+=(chr(t)+\" \")*k+\"\\n\"\n", 47 | " t+=1 \n", 48 | " z+=1\n", 49 | " if z==k:\n", 50 | " break\n", 51 | " return l\n", 52 | "print(kelime(\"K\",7))" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 1, 58 | "id": "5f9de12b", 59 | "metadata": {}, 60 | "outputs": [ 61 | { 62 | "name": "stdout", 63 | "output_type": "stream", 64 | "text": [ 65 | "Enter No Of Rows:7\n", 66 | "A A A A A A A \n", 67 | "B B B B B B B \n", 68 | "C C C C C C C \n", 69 | "D D D D D D D \n", 70 | "E E E E E E E \n", 71 | "F F F F F F F \n", 72 | "G G G G G G G \n" 73 | ] 74 | } 75 | ], 76 | "source": [ 77 | "n=int(input('Enter No Of Rows:'))\n", 78 | "for i in range(n):\n", 79 | " print((chr(65+i)+' ')*n)" 80 | ] 81 | } 82 | ], 83 | "metadata": { 84 | "kernelspec": { 85 | "display_name": "Python 3", 86 | "language": "python", 87 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 88 | }, 89 | "language_info": { 90 | "codemirror_mode": { 91 | "name": "ipython", 92 | "version": 3 93 | }, 94 | "file_extension": ".py", 95 | "mimetype": "text/x-python", 96 | "name": "python", 97 | "nbconvert_exporter": "python", 98 | "pygments_lexer": "ipython3", 99 | "version": "3.9.7" 100 | } 101 | }, 102 | "nbformat": 4, 103 | "nbformat_minor": 5 104 | } 105 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Sum_of_Nested_List-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "7ae66a34", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "80\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "def liste(n):\n", 19 | " t=0\n", 20 | " for i in n:\n", 21 | " for j in i:\n", 22 | " t+=j\n", 23 | " return t\n", 24 | "print(liste([[1,4,5],[7,3],[4],[46,7,3]]))" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": 3, 30 | "id": "0fafcf95", 31 | "metadata": {}, 32 | "outputs": [ 33 | { 34 | "name": "stdout", 35 | "output_type": "stream", 36 | "text": [ 37 | "80\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "test_list = [[1,4,5], [7,3],[4],[46,7,3]]\n", 43 | "summ = 0\n", 44 | "summ = sum([summ + sum(i) for i in test_list])\n", 45 | "print(summ)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 4, 51 | "id": "0fd68a4f", 52 | "metadata": {}, 53 | "outputs": [ 54 | { 55 | "name": "stdout", 56 | "output_type": "stream", 57 | "text": [ 58 | "80\n" 59 | ] 60 | } 61 | ], 62 | "source": [ 63 | "result = sum([x for x in test_list for x in x])\n", 64 | "print(result)" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 7, 70 | "id": "70b5cc8c", 71 | "metadata": {}, 72 | "outputs": [ 73 | { 74 | "data": { 75 | "text/plain": [ 76 | "59" 77 | ] 78 | }, 79 | "execution_count": 7, 80 | "metadata": {}, 81 | "output_type": "execute_result" 82 | } 83 | ], 84 | "source": [ 85 | "test_list = [[2,4,5], [7,8,9], [0,2,4], [5,5,8]]\n", 86 | "\n", 87 | "result = sum(list(map(lambda x : sum(x), test_list)))\n", 88 | "result" 89 | ] 90 | }, 91 | { 92 | "cell_type": "code", 93 | "execution_count": null, 94 | "id": "a332f813", 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [] 98 | } 99 | ], 100 | "metadata": { 101 | "kernelspec": { 102 | "display_name": "Python 3", 103 | "language": "python", 104 | "name": "python3" 105 | }, 106 | "language_info": { 107 | "codemirror_mode": { 108 | "name": "ipython", 109 | "version": 3 110 | }, 111 | "file_extension": ".py", 112 | "mimetype": "text/x-python", 113 | "name": "python", 114 | "nbconvert_exporter": "python", 115 | "pygments_lexer": "ipython3", 116 | "version": "3.8.8" 117 | } 118 | }, 119 | "nbformat": 4, 120 | "nbformat_minor": 5 121 | } 122 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Tersten_Yazdirma-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "eb11a188", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Bir foksiyon tanımlayın ve foksiyonun sonucunda girilen her kelimeyi kendi içinde\n", 11 | "tersten yazdırın: given str =\"My Name is Muhammet\" expected_out_put: 'yM emaN si temmahuM'" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 9, 17 | "id": "66450fde", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "yM emaN si temmahuM \n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "string =\"My Name is Muhammet\"\n", 30 | "lst = string.split(\" \")\n", 31 | "lst_new = \"\"\n", 32 | "for i in lst:\n", 33 | " lst_new += i[::-1] + \" \" \n", 34 | "print(lst_new)" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 12, 40 | "id": "9c796f11", 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "def reverse_word(sentence) :\n", 45 | " wordlst = sentence.split(\" \")\n", 46 | " new_sentence = \"\"\n", 47 | " for i in wordlst :\n", 48 | " new_sentence += i[::-1] \n", 49 | " new_sentence += \" \"\n", 50 | " \n", 51 | " \n", 52 | " return new_sentence" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 13, 58 | "id": "8e3aab5c", 59 | "metadata": {}, 60 | "outputs": [ 61 | { 62 | "data": { 63 | "text/plain": [ 64 | "'yM emaN si temmahuM'" 65 | ] 66 | }, 67 | "execution_count": 13, 68 | "metadata": {}, 69 | "output_type": "execute_result" 70 | } 71 | ], 72 | "source": [ 73 | "def reverse(text):\n", 74 | " new = text.split(' ')\n", 75 | " lst = [i[::-1] for i in new]\n", 76 | " string= \" \".join(lst)\n", 77 | " return string\n", 78 | "reverse(\"My Name is Muhammet\")" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "id": "9c549d52", 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | } 89 | ], 90 | "metadata": { 91 | "kernelspec": { 92 | "display_name": "Python 3", 93 | "language": "python", 94 | "name": "python3" 95 | }, 96 | "language_info": { 97 | "codemirror_mode": { 98 | "name": "ipython", 99 | "version": 3 100 | }, 101 | "file_extension": ".py", 102 | "mimetype": "text/x-python", 103 | "name": "python", 104 | "nbconvert_exporter": "python", 105 | "pygments_lexer": "ipython3", 106 | "version": "3.8.8" 107 | } 108 | }, 109 | "nbformat": 4, 110 | "nbformat_minor": 5 111 | } 112 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Tersten_Yazdirma2-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3ee405fd", 6 | "metadata": {}, 7 | "source": [ 8 | "Bir foksiyon tanımlayın ve foksiyonun sonucunda girilen her \n", 9 | "kelimeyi kendi içinde tersten yazdırın: \n", 10 | "given str =\"My Name is Muhammet\" expected_out_put: 'yM emaN si temmahuM'" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 4, 16 | "id": "bc107b52", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "data": { 21 | "text/plain": [ 22 | "'yM emaN si temmahuM'" 23 | ] 24 | }, 25 | "execution_count": 4, 26 | "metadata": {}, 27 | "output_type": "execute_result" 28 | } 29 | ], 30 | "source": [ 31 | "def reversewords(sentence) :\n", 32 | " wordslists = sentence.split(\" \")\n", 33 | " new_sentence = \"\"\n", 34 | " for i in wordslists :\n", 35 | " new_sentence += i[::-1] \n", 36 | " new_sentence += \" \"\n", 37 | " \n", 38 | " \n", 39 | " return new_sentence[:len(sentence)]\n", 40 | "reversewords(\"My Name is Muhammet\")" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": 5, 46 | "id": "b2ed3710", 47 | "metadata": {}, 48 | "outputs": [ 49 | { 50 | "data": { 51 | "text/plain": [ 52 | "['Mike', 'Emme', 'Kelly', 'Brad']" 53 | ] 54 | }, 55 | "execution_count": 5, 56 | "metadata": {}, 57 | "output_type": "execute_result" 58 | } 59 | ], 60 | "source": [ 61 | "list1= ['Mike', \"\", 'Emme', \"\", 'Kelly', \"\", 'Brad']\n", 62 | "\n", 63 | "result = list(filter(lambda x: x != \"\", list1))\n", 64 | "result" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "235084ba", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "id": "6601415c", 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [] 82 | } 83 | ], 84 | "metadata": { 85 | "kernelspec": { 86 | "display_name": "Python 3", 87 | "language": "python", 88 | "name": "python3" 89 | }, 90 | "language_info": { 91 | "codemirror_mode": { 92 | "name": "ipython", 93 | "version": 3 94 | }, 95 | "file_extension": ".py", 96 | "mimetype": "text/x-python", 97 | "name": "python", 98 | "nbconvert_exporter": "python", 99 | "pygments_lexer": "ipython3", 100 | "version": "3.8.8" 101 | } 102 | }, 103 | "nbformat": 4, 104 | "nbformat_minor": 5 105 | } 106 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/Triangle_Challenge-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Addicts/.ipynb_checkpoints/sortlist_without.sort()_method-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "6207af0a", 6 | "metadata": {}, 7 | "source": [ 8 | "Write a Python code to sort the list at below without using .sort() method of list. \n", 9 | "elements of list = [999, 333, 2, 8982, 12, 45, 77, 99, 11] \n", 10 | "Expected output: [2, 11, 12, 45, 77, 99, 333, 999, 8982]" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "2bda915c", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "a = [999, 333, 2, 8982, 12, 45, 77, 99, 11]\n", 21 | "b = []\n", 22 | "for i in range(len(a)):\n", 23 | " maximum = max(a)\n", 24 | " b.append(maximum)\n", 25 | " a.remove(maximum)\n", 26 | " b.reverse()\n", 27 | "print(b)" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "id": "fa78b493", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "elements_list = [999, 333, 2, 8982, 12, 45, 77, 99, 11]\n", 38 | "new_list = []\n", 39 | "i = 1\n", 40 | "loop = len(elements_list)\n", 41 | "while i <= loop:\n", 42 | " min1 = min(elements_list)\n", 43 | " new_list.append(min1)\n", 44 | " elements_list.remove(min1)\n", 45 | " i += 1\n", 46 | "print(new_list)" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": null, 52 | "id": "e9266511", 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": null, 60 | "id": "e7945a40", 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": null, 68 | "id": "12b04a5c", 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "id": "e0f62c3a", 77 | "metadata": {}, 78 | "outputs": [], 79 | "source": [] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "id": "472fb888", 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | } 89 | ], 90 | "metadata": { 91 | "kernelspec": { 92 | "display_name": "Python 3", 93 | "language": "python", 94 | "name": "python3" 95 | }, 96 | "language_info": { 97 | "codemirror_mode": { 98 | "name": "ipython", 99 | "version": 3 100 | }, 101 | "file_extension": ".py", 102 | "mimetype": "text/x-python", 103 | "name": "python", 104 | "nbconvert_exporter": "python", 105 | "pygments_lexer": "ipython3", 106 | "version": "3.8.8" 107 | } 108 | }, 109 | "nbformat": 4, 110 | "nbformat_minor": 5 111 | } 112 | -------------------------------------------------------------------------------- /Python-Addicts/19-09-2021.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Addicts/19-09-2021.txt -------------------------------------------------------------------------------- /Python-Addicts/Accumulating_List.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "caf37ffa", 6 | "metadata": {}, 7 | "source": [ 8 | "accumulating_list([1, 2, 3, 4]) ➞ [1, 3, 6, 10]\n", 9 | " [1, 3, 6, 10] can be written as [1, 1 + 2, 1 + 2 + 3, 1 + 2 + 3 + 4]\n", 10 | "\n", 11 | "accumulating_list([1, 5, 7]) ➞ [1, 6, 13]\n", 12 | "\n", 13 | "accumulating_list([1, 0, 1, 0, 1]) ➞ [1, 1, 2, 2, 3]\n", 14 | "\n", 15 | "accumulating_list([]) ➞ []" 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": null, 21 | "id": "4efe7f87", 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "def accumulating_list(list1):\n", 26 | " return [sum(list1[:i+1]) for i in range(len(list1))]" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "id": "146a9c3a", 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "def accumulating_list(lst):\n", 37 | "\treturn [\n", 38 | "\t\tsum(lst[:num])\n", 39 | "\t\tfor num in range(1, len(lst) + 1)\n", 40 | "\t]" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "40c5c31a", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "def accumulating_list(lst):\n", 51 | " sum=0\n", 52 | " sum_list=[]\n", 53 | " for a in lst:\n", 54 | " sum+=a\n", 55 | " sum_list.append(sum)\n", 56 | " return sum_list" 57 | ] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "id": "e26e7f15", 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "109b32b5", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | } 75 | ], 76 | "metadata": { 77 | "kernelspec": { 78 | "display_name": "Python 3", 79 | "language": "python", 80 | "name": "python3" 81 | }, 82 | "language_info": { 83 | "codemirror_mode": { 84 | "name": "ipython", 85 | "version": 3 86 | }, 87 | "file_extension": ".py", 88 | "mimetype": "text/x-python", 89 | "name": "python", 90 | "nbconvert_exporter": "python", 91 | "pygments_lexer": "ipython3", 92 | "version": "3.8.8" 93 | } 94 | }, 95 | "nbformat": 4, 96 | "nbformat_minor": 5 97 | } 98 | -------------------------------------------------------------------------------- /Python-Addicts/Add_Dots Functions.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "bd2d5414", 6 | "metadata": {}, 7 | "source": [ 8 | "- Write a function named add_dots that takes a string and adds \".\" in between each letter.\n", 9 | "- For example\n", 10 | "- calling add_dots(\"test\") should return the string \"t.e.s.t\".\n", 11 | "- Then, below the add_dots function,\n", 12 | "- write another function named remove_dots that removes all dots from a string.\n", 13 | "- For example\n", 14 | "- calling remove_dots(\"t.e.s.t\") should return \"test\".\n", 15 | "- If both functions are correct,\n", 16 | "- calling remove_dots(add_dots(string)) should return back the original string for any string." 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": null, 22 | "id": "6e63ff89", 23 | "metadata": {}, 24 | "outputs": [], 25 | "source": [ 26 | "def add_dots(string):\n", 27 | " return \".\".join(string)\n", 28 | "\n", 29 | "def remove_dots(string):\n", 30 | " return string.replace(\".\", \"\")\n", 31 | "\n", 32 | "remove_dots(add_dots(\"altay\"))" 33 | ] 34 | } 35 | ], 36 | "metadata": { 37 | "kernelspec": { 38 | "display_name": "Python 3", 39 | "language": "python", 40 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 41 | }, 42 | "language_info": { 43 | "codemirror_mode": { 44 | "name": "ipython", 45 | "version": 3 46 | }, 47 | "file_extension": ".py", 48 | "mimetype": "text/x-python", 49 | "name": "python", 50 | "nbconvert_exporter": "python", 51 | "pygments_lexer": "ipython3", 52 | "version": "3.9.7" 53 | } 54 | }, 55 | "nbformat": 4, 56 | "nbformat_minor": 5 57 | } 58 | -------------------------------------------------------------------------------- /Python-Addicts/Ara_toplam_haric.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "source": [ 6 | "Bir fonksiyon yazınız; Fonksiyonunuz, kullanıcıdan 2 sayı istesin ve \n", 7 | "kullanıcıdan girilen sayılar arasındaki sayıların toplamını çıktı olarak versin. \n", 8 | "Kullanıcıdan alınan sayılar toplama dahil edilmesin. Herkese kolay gelsin. \n", 9 | "\n", 10 | "For Example:\n", 11 | "Input (5, 12)\n", 12 | "Output (41)" 13 | ], 14 | "metadata": {} 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 14, 19 | "source": [ 20 | "def ara_toplam(a,b):\n", 21 | " toplam=0\n", 22 | " for i in range(a+1, b):\n", 23 | " toplam+=i\n", 24 | " return toplam\n", 25 | "\n", 26 | "ara_toplam(5,12)\n" 27 | ], 28 | "outputs": [ 29 | { 30 | "output_type": "execute_result", 31 | "data": { 32 | "text/plain": [ 33 | "51" 34 | ] 35 | }, 36 | "metadata": {}, 37 | "execution_count": 14 38 | } 39 | ], 40 | "metadata": {} 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "source": [ 45 | "Create a function that takes two numbers as arguments and return their sum.\n", 46 | "Examples\n", 47 | "addition(3, 2) ➞ 5\n", 48 | "addition(-3, -6) ➞ -9\n", 49 | "addition(7, 3) ➞ 10" 50 | ], 51 | "metadata": {} 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 2, 56 | "source": [ 57 | "def addition(x, y):\n", 58 | " return x+y\n", 59 | "addition(-3, -6)" 60 | ], 61 | "outputs": [ 62 | { 63 | "output_type": "execute_result", 64 | "data": { 65 | "text/plain": [ 66 | "-9" 67 | ] 68 | }, 69 | "metadata": {}, 70 | "execution_count": 2 71 | } 72 | ], 73 | "metadata": {} 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "source": [ 79 | "ef addition(x, y):\n", 80 | " return x+y\n", 81 | "addition(-4, -8)" 82 | ], 83 | "outputs": [], 84 | "metadata": {} 85 | } 86 | ], 87 | "metadata": { 88 | "kernelspec": { 89 | "display_name": "Python 3", 90 | "language": "python", 91 | "name": "python3" 92 | }, 93 | "language_info": { 94 | "codemirror_mode": { 95 | "name": "ipython", 96 | "version": 3 97 | }, 98 | "file_extension": ".py", 99 | "mimetype": "text/x-python", 100 | "name": "python", 101 | "nbconvert_exporter": "python", 102 | "pygments_lexer": "ipython3", 103 | "version": "3.8.8" 104 | } 105 | }, 106 | "nbformat": 4, 107 | "nbformat_minor": 5 108 | } -------------------------------------------------------------------------------- /Python-Addicts/Artan_Düzende_Sıralanmış_Liste.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "13c7d8bb", 6 | "metadata": {}, 7 | "source": [ 8 | "Verilen bir boş olmayan demetler listesinden her bir demetteki son elemana göre \n", 9 | "artan düzende sıralanmış bir liste elde etmek için bir Python programı yazın.\n", 10 | "Örnek Liste : [(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]\n", 11 | "Beklenen Sonuç : [(2, 1), (1 , 2), (2, 3), (4, 4), (2, 5)]" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 6, 17 | "id": "96329534", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "[(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)]\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "liste = [(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]\n", 30 | "new = []\n", 31 | "newest = []\n", 32 | "for k, v in liste:\n", 33 | " new.append((v, k))\n", 34 | "new.sort()\n", 35 | "for k, v in new:\n", 36 | " newest.append((v, k))\n", 37 | "print(newest)" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": 3, 43 | "id": "34d8f745", 44 | "metadata": {}, 45 | "outputs": [ 46 | { 47 | "name": "stdout", 48 | "output_type": "stream", 49 | "text": [ 50 | "[(5, 2), (2, 1), (4, 4), (3, 2), (1, 2)]\n", 51 | "[(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)]\n" 52 | ] 53 | } 54 | ], 55 | "source": [ 56 | "a=[(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]\n", 57 | "#print([j[::-1] for j in sorted([i[::-1] for i in a])])\n", 58 | "b=[]\n", 59 | "c=[]\n", 60 | "for i in a:\n", 61 | " b.append(i[::-1])\n", 62 | "print(b)\n", 63 | "for i in sorted(b):\n", 64 | " c.append(i[::-1])\n", 65 | "print(c)" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "id": "3d8e1668", 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [] 75 | } 76 | ], 77 | "metadata": { 78 | "kernelspec": { 79 | "display_name": "Python 3", 80 | "language": "python", 81 | "name": "python3" 82 | }, 83 | "language_info": { 84 | "codemirror_mode": { 85 | "name": "ipython", 86 | "version": 3 87 | }, 88 | "file_extension": ".py", 89 | "mimetype": "text/x-python", 90 | "name": "python", 91 | "nbconvert_exporter": "python", 92 | "pygments_lexer": "ipython3", 93 | "version": "3.8.8" 94 | } 95 | }, 96 | "nbformat": 4, 97 | "nbformat_minor": 5 98 | } 99 | -------------------------------------------------------------------------------- /Python-Addicts/Comfortable_words.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3bb92cae", 6 | "metadata": {}, 7 | "source": [ 8 | "A comfortable word is a word which you can type always alternating the hand you type \n", 9 | "with (assuming you type using a QWERTY keyboard and use fingers as shown in the image below).\n", 10 | "\n", 11 | "That being said, create a function which receives a word and returns true/True \n", 12 | "if it's a comfortable word and false/False otherwise.\n", 13 | "\n", 14 | "The word will always be a string consisting of only ascii letters from a to z.\n", 15 | "To avoid problems with image availability, here's the lists of letters for each hand:\n", 16 | "\n", 17 | "Left: q, w, e, r, t, a, s, d, f, g, z, x, c, v, b\n", 18 | "Right: y, u, i, o, p, h, j, k, l, n, m" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 3, 24 | "id": "f3dbdd7d", 25 | "metadata": {}, 26 | "outputs": [ 27 | { 28 | "name": "stdout", 29 | "output_type": "stream", 30 | "text": [ 31 | "Enter a word:polly\n", 32 | "False\n" 33 | ] 34 | } 35 | ], 36 | "source": [ 37 | "left = {'q', 'w', 'e', 'r', 't', 'a', 's', 'd', 'f', 'g', 'z', 'x', 'c', 'v', 'b'}\n", 38 | "right = {'y', 'u', 'i', 'o', 'p', 'h', 'j', 'k', 'l', 'n', 'm'}\n", 39 | "word = input('Enter a word:')\n", 40 | "print((set(word) & left) != set() and (set(word) & right) != set())" 41 | ] 42 | } 43 | ], 44 | "metadata": { 45 | "kernelspec": { 46 | "display_name": "Python 3", 47 | "language": "python", 48 | "name": "python3" 49 | }, 50 | "language_info": { 51 | "codemirror_mode": { 52 | "name": "ipython", 53 | "version": 3 54 | }, 55 | "file_extension": ".py", 56 | "mimetype": "text/x-python", 57 | "name": "python", 58 | "nbconvert_exporter": "python", 59 | "pygments_lexer": "ipython3", 60 | "version": "3.8.8" 61 | } 62 | }, 63 | "nbformat": 4, 64 | "nbformat_minor": 5 65 | } 66 | -------------------------------------------------------------------------------- /Python-Addicts/Comma_Separated_Sequence.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "5f419af5", 6 | "metadata": {}, 7 | "source": [ 8 | "Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically.\n", 9 | "Suppose the following input is supplied to the program:\n", 10 | "without,hello,bag,world\n", 11 | "Then, the output should be:\n", 12 | "bag,hello,without,world" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": null, 18 | "id": "f09dc67c", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "def comma(string):\n", 23 | " liste = string.split(\",\")\n", 24 | " liste1 = []\n", 25 | " for i in liste:\n", 26 | " liste1.append(i.lower())\n", 27 | " return sorted(liste1)\n", 28 | "comma(\"steive,dustin,Bean,Enzo,murat,adsum,muhammet,burak\")" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 1, 34 | "id": "0a638f6a", 35 | "metadata": {}, 36 | "outputs": [ 37 | { 38 | "data": { 39 | "text/plain": [ 40 | "['adsum', 'bean', 'burak', 'dustin', 'enzo', 'muhammet', 'murat', 'steive']" 41 | ] 42 | }, 43 | "execution_count": 1, 44 | "metadata": {}, 45 | "output_type": "execute_result" 46 | } 47 | ], 48 | "source": [ 49 | "def ayir(words):\n", 50 | " return sorted([i.lower() for i in words.split(\",\")])\n", 51 | "ayir(\"steive,dustin,Bean,Enzo,murat,adsum,muhammet,burak\")" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": null, 57 | "id": "10955ff5", 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [] 61 | } 62 | ], 63 | "metadata": { 64 | "kernelspec": { 65 | "display_name": "Python 3", 66 | "language": "python", 67 | "name": "python3" 68 | }, 69 | "language_info": { 70 | "codemirror_mode": { 71 | "name": "ipython", 72 | "version": 3 73 | }, 74 | "file_extension": ".py", 75 | "mimetype": "text/x-python", 76 | "name": "python", 77 | "nbconvert_exporter": "python", 78 | "pygments_lexer": "ipython3", 79 | "version": "3.8.8" 80 | } 81 | }, 82 | "nbformat": 4, 83 | "nbformat_minor": 5 84 | } 85 | -------------------------------------------------------------------------------- /Python-Addicts/Datetime_Modülü.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0dc15742", 6 | "metadata": {}, 7 | "source": [ 8 | "Use datetime modul and create a file . Output : \" Python 02-09-2021.txt \"\n" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "5149544e", 15 | "metadata": {}, 16 | "outputs": [ 17 | { 18 | "name": "stdout", 19 | "output_type": "stream", 20 | "text": [ 21 | "created 19-09-2021.txt\n" 22 | ] 23 | } 24 | ], 25 | "source": [ 26 | "from datetime import datetime\n", 27 | "x= datetime.now()\n", 28 | "file_name = x.strftime('%d-%m-%Y.txt')\n", 29 | "with open(file_name, 'w') as fp:\n", 30 | " print('created', file_name)" 31 | ] 32 | } 33 | ], 34 | "metadata": { 35 | "kernelspec": { 36 | "display_name": "Python 3", 37 | "language": "python", 38 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 39 | }, 40 | "language_info": { 41 | "codemirror_mode": { 42 | "name": "ipython", 43 | "version": 3 44 | }, 45 | "file_extension": ".py", 46 | "mimetype": "text/x-python", 47 | "name": "python", 48 | "nbconvert_exporter": "python", 49 | "pygments_lexer": "ipython3", 50 | "version": "3.9.7" 51 | } 52 | }, 53 | "nbformat": 4, 54 | "nbformat_minor": 5 55 | } 56 | -------------------------------------------------------------------------------- /Python-Addicts/Digits_Sum_Up10.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "65f89e71", 6 | "metadata": {}, 7 | "source": [ 8 | "This is an interview question asked by Microsoft.\n", 9 | "\n", 10 | "A number is considered perfect if its digits sum up to exactly 10.\n", 11 | "\n", 12 | "Given a positive integer n, return the n-th perfect number.\n", 13 | "\n", 14 | "For example, given 1, you should return 19. Given 2, you should return 28." 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 3, 20 | "id": "0e6b9978", 21 | "metadata": {}, 22 | "outputs": [ 23 | { 24 | "name": "stdout", 25 | "output_type": "stream", 26 | "text": [ 27 | "28\n" 28 | ] 29 | } 30 | ], 31 | "source": [ 32 | "def perfect(n):\n", 33 | " top = 0\n", 34 | " count = 0\n", 35 | " number = 10\n", 36 | " while count < n:\n", 37 | " number+=9\n", 38 | " count+=1\n", 39 | " for i in str(number):\n", 40 | " top += int(i)\n", 41 | " if top == 10:\n", 42 | " break\n", 43 | " return number\n", 44 | "print(perfect(2))" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "e53c5fbb", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "a6cba5b8", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "0ce72012", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.8.8" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /Python-Addicts/Fibonacci dizisi.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "1ec243c4", 6 | "metadata": {}, 7 | "source": [ 8 | "ir soruda benden Fibonacci dizisini 0 ile 50 arasında almak için bir Python programı yazın .\n", 9 | "Not: Fibonacci Dizisi,\n", 10 | "0, 1, 1, 2, 3, 5, 8, 13, 21, sayıları dizisidir .\n", 11 | "Her sonraki sayı, kendisinden önceki iki sayı toplanarak bulunur.\n", 12 | "Beklenen Çıktı : 1 1 2 3 5 8 13 21 34" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": null, 18 | "id": "cfbc4046", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "x,y=0,1\n", 23 | "fibonacci=[]\n", 24 | "while x+y<50:\n", 25 | " x,y = y,x+y\n", 26 | " fibonacci.append(y)\n", 27 | "print(\"fibonacci sayıları:\", fibonacci)" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "id": "40a13461", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "x, y, z = 0, 1, 2\n", 38 | "iboilenaci=[]\n", 39 | "while z < 50:\n", 40 | " z = x + y\n", 41 | " x = y\n", 42 | " y = z\n", 43 | " iboilenaci.append(x)\n", 44 | "print(\"fibonacci sayıları:\", iboilenaci)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "c0bd676a", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "liste = [0 ,1]\n", 55 | "total = 0\n", 56 | "while True:\n", 57 | " total = liste[-2] + total\n", 58 | " liste.append(total)\n", 59 | " if total + liste[-2] > 50:\n", 60 | " break\n", 61 | "print(' '.join('{}'.format(i) for i in liste))" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "24b7f3bd", 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [ 71 | "liste = [0,1]\n", 72 | "a,b=0,1\n", 73 | "while a<48:\n", 74 | " toplam=liste[a] + liste[b]\n", 75 | " liste.insert(b+1,toplam)\n", 76 | " a += 1\n", 77 | " b += 1\n", 78 | "print(liste)\n", 79 | "print(len(liste))" 80 | ] 81 | }, 82 | { 83 | "cell_type": "code", 84 | "execution_count": null, 85 | "id": "dd25caba", 86 | "metadata": {}, 87 | "outputs": [], 88 | "source": [] 89 | } 90 | ], 91 | "metadata": { 92 | "kernelspec": { 93 | "display_name": "Python 3", 94 | "language": "python", 95 | "name": "python3" 96 | }, 97 | "language_info": { 98 | "codemirror_mode": { 99 | "name": "ipython", 100 | "version": 3 101 | }, 102 | "file_extension": ".py", 103 | "mimetype": "text/x-python", 104 | "name": "python", 105 | "nbconvert_exporter": "python", 106 | "pygments_lexer": "ipython3", 107 | "version": "3.8.8" 108 | } 109 | }, 110 | "nbformat": 4, 111 | "nbformat_minor": 5 112 | } 113 | -------------------------------------------------------------------------------- /Python-Addicts/Index_of_Caps_Letter.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "7ee116c4", 6 | "metadata": {}, 7 | "source": [ 8 | "Create a function that takes a single string as argument and returns an ordered list containing the indices of all capital letters in the string.\n", 9 | "\n", 10 | "Examples\n", 11 | "index_of_caps(\"eDaBiT\") ➞ [1, 3, 5]\n", 12 | "\n", 13 | "index_of_caps(\"eQuINoX\") ➞ [1, 3, 4, 6]\n", 14 | "\n", 15 | "index_of_caps(\"determine\") ➞ []\n", 16 | "\n", 17 | "index_of_caps(\"STRIKE\") ➞ [0, 1, 2, 3, 4, 5]\n", 18 | "\n", 19 | "index_of_caps(\"sUn\") ➞ [1]\n", 20 | "Notes\n", 21 | "Return an empty list if no uppercase letters are found in the string.\n", 22 | "Special characters ($#@%) and numbers will be included in some test cases.\n", 23 | "Assume all words do not have duplicate letters." 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "id": "9f037213", 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "def index_of_caps(word):\n", 34 | "\tresult = []\n", 35 | "\tfor i in word:\n", 36 | "\t\tif i.isupper():\n", 37 | "\t\t\tresult.append(word.index(i))\n", 38 | "\treturn result" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "id": "cedc1b1a", 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "def index_of_caps(word):\n", 49 | "\treturn [word.index(i) for i in word if i.isupper()]" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": null, 55 | "id": "d1310292", 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "def index_of_caps(word):\n", 60 | " return [i for i in range(len(word)) if word[i].isupper()]" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "d187b553", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "def index_of_caps(word):\n", 71 | " return [i for i in range(len(word)) if word[i].isupper()]" 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "execution_count": null, 77 | "id": "b1caa3c0", 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [] 81 | } 82 | ], 83 | "metadata": { 84 | "kernelspec": { 85 | "display_name": "Python 3", 86 | "language": "python", 87 | "name": "python3" 88 | }, 89 | "language_info": { 90 | "codemirror_mode": { 91 | "name": "ipython", 92 | "version": 3 93 | }, 94 | "file_extension": ".py", 95 | "mimetype": "text/x-python", 96 | "name": "python", 97 | "nbconvert_exporter": "python", 98 | "pygments_lexer": "ipython3", 99 | "version": "3.8.8" 100 | } 101 | }, 102 | "nbformat": 4, 103 | "nbformat_minor": 5 104 | } 105 | -------------------------------------------------------------------------------- /Python-Addicts/Lesteden_Eleman_Cikarma.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "91df78b6", 6 | "metadata": {}, 7 | "source": [ 8 | "0., 4. ve 5. elemanları çıkardıktan sonra belirtilen listeyi yazdıracak bir Python programı yazın. \n", 9 | "Örnek Liste : ['Kırmızı', 'Yeşil', 'Beyaz', 'Siyah', 'Pembe', 'Sarı']\n", 10 | "Beklenen Çıktı : ['Yeşil', 'Beyaz', 'Siyah']\n", 11 | "Not: 3 satırda yapın." 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 1, 17 | "id": "65cf91a4", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "['Yeşil', 'Beyaz', 'Siyah']\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "liste = ['Kırmızı', 'Yeşil', 'Beyaz', 'Siyah', 'Pembe', 'Sarı']\n", 30 | "a = list(filter(lambda x : x == liste[1] or x == liste[2] or x == liste[3], liste))\n", 31 | "print(a)" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 2, 37 | "id": "9f0affd0", 38 | "metadata": {}, 39 | "outputs": [ 40 | { 41 | "data": { 42 | "text/plain": [ 43 | "['Yeşil', 'Beyaz', 'Siyah']" 44 | ] 45 | }, 46 | "execution_count": 2, 47 | "metadata": {}, 48 | "output_type": "execute_result" 49 | } 50 | ], 51 | "source": [ 52 | "def cıkar(lstx):\n", 53 | " new_lst =[]\n", 54 | " k = 0\n", 55 | " while k < len(lstx):\n", 56 | " if k != 0 and k != 4 and k != 5:\n", 57 | " new_lst.append(lstx[k])\n", 58 | " k += 1\n", 59 | " return new_lst\n", 60 | "\n", 61 | "cıkar(['Kırmızı', 'Yeşil', 'Beyaz', 'Siyah', 'Pembe', 'Sarı'])" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "c109a9f8", 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [] 71 | } 72 | ], 73 | "metadata": { 74 | "kernelspec": { 75 | "display_name": "Python 3", 76 | "language": "python", 77 | "name": "python3" 78 | }, 79 | "language_info": { 80 | "codemirror_mode": { 81 | "name": "ipython", 82 | "version": 3 83 | }, 84 | "file_extension": ".py", 85 | "mimetype": "text/x-python", 86 | "name": "python", 87 | "nbconvert_exporter": "python", 88 | "pygments_lexer": "ipython3", 89 | "version": "3.8.8" 90 | } 91 | }, 92 | "nbformat": 4, 93 | "nbformat_minor": 5 94 | } 95 | -------------------------------------------------------------------------------- /Python-Addicts/Lexicographical_Order.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "1afdc210", 6 | "metadata": {}, 7 | "source": [ 8 | "1- Given two arrays of strings a1 and a2 return a sorted array r in lexicographical order of the strings of a1 which are substrings of strings of a2.\n", 9 | "\n", 10 | "Example 1: a1 = [\"arp\", \"live\", \"strong\"]\n", 11 | "\n", 12 | "a2 = [\"lively\", \"alive\", \"harp\", \"sharp\", \"armstrong\"]\n", 13 | "\n", 14 | "returns [\"arp\", \"live\", \"strong\"]\n", 15 | "\n", 16 | "Example 2: a1 = [\"tarp\", \"mice\", \"bull\"]\n", 17 | "\n", 18 | "a2 = [\"lively\", \"alive\", \"harp\", \"sharp\", \"armstrong\"]\n", 19 | "\n", 20 | "returns []\n", 21 | "\n", 22 | "Notes: Arrays are written in \"general\" notation. See \"Your Test Cases\" for examples in your language.\n", 23 | "\n", 24 | "In Shell bash a1 and a2 are strings. The return is a string where words are separated by commas." 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": null, 30 | "id": "9b73ac89", 31 | "metadata": {}, 32 | "outputs": [], 33 | "source": [ 34 | "a1 = [\"arp\", \"live\", \"strong\"]\n", 35 | "a2 = [\"lively\", \"alive\", \"harp\", \"sharp\", \"armstrong\"]\n", 36 | "lst = []\n", 37 | "for i in a1:\n", 38 | " for j in a2:\n", 39 | " if i in j and i not in lst:\n", 40 | " lst.append(i)\n", 41 | "print(lst) " 42 | ] 43 | } 44 | ], 45 | "metadata": { 46 | "kernelspec": { 47 | "display_name": "Python 3", 48 | "language": "python", 49 | "name": "python3" 50 | }, 51 | "language_info": { 52 | "codemirror_mode": { 53 | "name": "ipython", 54 | "version": 3 55 | }, 56 | "file_extension": ".py", 57 | "mimetype": "text/x-python", 58 | "name": "python", 59 | "nbconvert_exporter": "python", 60 | "pygments_lexer": "ipython3", 61 | "version": "3.8.8" 62 | } 63 | }, 64 | "nbformat": 4, 65 | "nbformat_minor": 5 66 | } 67 | -------------------------------------------------------------------------------- /Python-Addicts/List_of_Tuples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "7f0fc66d", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "[('z', 0), ('b', 1), ('c', 2), ('x', 3), ('x', 4)]\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "liste = [('b', 1), ('c', 2), ('x', 3), ('x', 4), ('z', 0)]\n", 19 | "liste = sorted([i[::-1] for i in liste])\n", 20 | "liste = [i[::-1] for i in liste]\n", 21 | "print(liste)" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 1, 27 | "id": "bf2206c8", 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "name": "stdout", 32 | "output_type": "stream", 33 | "text": [ 34 | "[('z', 0), ('b', 1), ('c', 2), ('x', 3), ('x', 4)]\n" 35 | ] 36 | } 37 | ], 38 | "source": [ 39 | "input=[(\"b\",1),(\"c\",2),(\"x\",3),(\"x\",4),(\"z\",0)]\n", 40 | "dicct={i:j for j,i in input}\n", 41 | "output=[(dicct[k],k) for k in sorted(dicct.keys())]\n", 42 | "print(output)" 43 | ] 44 | } 45 | ], 46 | "metadata": { 47 | "kernelspec": { 48 | "display_name": "Python 3", 49 | "language": "python", 50 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 51 | }, 52 | "language_info": { 53 | "codemirror_mode": { 54 | "name": "ipython", 55 | "version": 3 56 | }, 57 | "file_extension": ".py", 58 | "mimetype": "text/x-python", 59 | "name": "python", 60 | "nbconvert_exporter": "python", 61 | "pygments_lexer": "ipython3", 62 | "version": "3.9.7" 63 | } 64 | }, 65 | "nbformat": 4, 66 | "nbformat_minor": 5 67 | } 68 | -------------------------------------------------------------------------------- /Python-Addicts/Longest_Alternating_Substring.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "f1463afc", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Given a string of digits, return the longest substring with alternating \n", 11 | "odd/even or even/odd digits. If two or more substrings have the same length, \n", 12 | "return the substring that occurs first.\n", 13 | "\n", 14 | "Examples\n", 15 | "longest_substring(\"225424272163254474441338664823\") ➞ \"272163254\"\n", 16 | "# substrings = 254, 272163254, 474, 41, 38, 23\n", 17 | "\n", 18 | "longest_substring(\"594127169973391692147228678476\") ➞ \"16921472\"\n", 19 | "# substrings = 94127, 169, 16921472, 678, 476\n", 20 | "\n", 21 | "longest_substring(\"721449827599186159274227324466\") ➞ \"7214\"\n", 22 | "# substrings = 7214, 498, 27, 18, 61, 9274, 27, 32\n", 23 | "# 7214 and 9274 have same length, but 7214 occurs first." 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "id": "12472b91", 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "id": "22279a0d", 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "ec8b7057", 46 | "metadata": {}, 47 | "outputs": [], 48 | "source": [] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": null, 53 | "id": "84af41f5", 54 | "metadata": {}, 55 | "outputs": [], 56 | "source": [] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "id": "9349af1c", 62 | "metadata": {}, 63 | "outputs": [], 64 | "source": [] 65 | } 66 | ], 67 | "metadata": { 68 | "kernelspec": { 69 | "display_name": "Python 3", 70 | "language": "python", 71 | "name": "python3" 72 | }, 73 | "language_info": { 74 | "codemirror_mode": { 75 | "name": "ipython", 76 | "version": 3 77 | }, 78 | "file_extension": ".py", 79 | "mimetype": "text/x-python", 80 | "name": "python", 81 | "nbconvert_exporter": "python", 82 | "pygments_lexer": "ipython3", 83 | "version": "3.8.8" 84 | } 85 | }, 86 | "nbformat": 4, 87 | "nbformat_minor": 5 88 | } 89 | -------------------------------------------------------------------------------- /Python-Addicts/Main_Number.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "44f311ef", 6 | "metadata": {}, 7 | "source": [ 8 | "The main number is 7.\n", 9 | "7 - 7 = 0\n", 10 | "7 - 8 = 1\n", 11 | "7 - 9 = 2\n", 12 | "The main number is 8.\n", 13 | "8 - 7 = 1\n", 14 | "8 - 8 = 0\n", 15 | "8 - 9 = 1\n", 16 | "The main number is 9.\n", 17 | "9 - 7 = 2\n", 18 | "9 - 8 = 1\n", 19 | "9 - 9 = 0" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "49ba343b", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "def main_number(n): \n", 30 | " a = n\n", 31 | " while n <= 9:\n", 32 | " y = a\n", 33 | " print(f'The main number is {n}.')\n", 34 | " while y <= 9:\n", 35 | " if n - y < 0:\n", 36 | " print(f'{n} - {y} = {-(n-y)}')\n", 37 | " else:\n", 38 | " print(f'{n} - {y} = {(n-y)}')\n", 39 | " y += 1\n", 40 | " n += 1\n", 41 | "\n", 42 | "main_number(5)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "id": "b6607c62", 49 | "metadata": {}, 50 | "outputs": [], 51 | "source": [ 52 | "def main_number(n): \n", 53 | " a = n\n", 54 | " while n <= 9:\n", 55 | " y = a\n", 56 | " print(f'The main number is {n}.')\n", 57 | " while y <= 9:\n", 58 | " print(f'{n} - {y} = {abs(n-y)}')\n", 59 | " y += 1\n", 60 | " n += 1\n", 61 | "main_number(5)" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "6ef466d3", 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [] 71 | }, 72 | { 73 | "cell_type": "code", 74 | "execution_count": null, 75 | "id": "62c5e53e", 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [] 79 | } 80 | ], 81 | "metadata": { 82 | "kernelspec": { 83 | "display_name": "Python 3", 84 | "language": "python", 85 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 86 | }, 87 | "language_info": { 88 | "codemirror_mode": { 89 | "name": "ipython", 90 | "version": 3 91 | }, 92 | "file_extension": ".py", 93 | "mimetype": "text/x-python", 94 | "name": "python", 95 | "nbconvert_exporter": "python", 96 | "pygments_lexer": "ipython3", 97 | "version": "3.9.7" 98 | } 99 | }, 100 | "nbformat": 4, 101 | "nbformat_minor": 5 102 | } 103 | -------------------------------------------------------------------------------- /Python-Addicts/Matriksler_challenge.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "7ab8c979", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "lst = [1,2,3]\n", 19 | "lst_new = []\n", 20 | "for i in lst:\n", 21 | " for j in lst:\n", 22 | " for k in lst:\n", 23 | " if i != j and j != k and i != k:\n", 24 | " lst_new.append([i,j,k])\n", 25 | "print(lst_new)\n" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 2, 31 | "id": "87d80bb2", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "name": "stdout", 36 | "output_type": "stream", 37 | "text": [ 38 | "[[1, 2, 3], [2, 3, 1], [3, 1, 2], [1, 2, 3], [2, 3, 1], [3, 1, 2]]\n" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "list1 = [1, 2, 3]\n", 44 | "i = 1\n", 45 | "fact = 1\n", 46 | "while i < len(list1) + 1 :\n", 47 | " fact *= i\n", 48 | " i += 1\n", 49 | "i = 1\n", 50 | "fact_dict = {}\n", 51 | "while i < fact + 1:\n", 52 | " fact_dict[i] = []\n", 53 | " i += 1\n", 54 | "\n", 55 | "indx= 0 \n", 56 | "for i in range(len(list1)):\n", 57 | " for k in range(1, fact+1):\n", 58 | " fact_dict[k].append(list1[indx])\n", 59 | " indx += 1\n", 60 | " if indx == len(list1):\n", 61 | " indx = 0\n", 62 | " indx += 1 \n", 63 | " \n", 64 | "print(list(fact_dict.values()))" 65 | ] 66 | } 67 | ], 68 | "metadata": { 69 | "kernelspec": { 70 | "display_name": "Python 3", 71 | "language": "python", 72 | "name": "python3" 73 | }, 74 | "language_info": { 75 | "codemirror_mode": { 76 | "name": "ipython", 77 | "version": 3 78 | }, 79 | "file_extension": ".py", 80 | "mimetype": "text/x-python", 81 | "name": "python", 82 | "nbconvert_exporter": "python", 83 | "pygments_lexer": "ipython3", 84 | "version": "3.8.8" 85 | } 86 | }, 87 | "nbformat": 4, 88 | "nbformat_minor": 5 89 | } 90 | -------------------------------------------------------------------------------- /Python-Addicts/Max_of_Three_Numbers.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "efebf6ba", 6 | "metadata": {}, 7 | "source": [ 8 | "Note: Built-in Functions kullanmayalım\n", 9 | "Write a Python function to find the Max of three numbers." 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "id": "880b3619", 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "liste = []\n", 20 | "while True:\n", 21 | " num = input(\"Enter a number or press 'q' to exit > \")\n", 22 | " if num.lower() == 'q':\n", 23 | " break\n", 24 | " else:\n", 25 | " liste.append(int(num))\n", 26 | " \n", 27 | "def maximum(): \n", 28 | " biggest = liste[0] \n", 29 | " for i in liste:\n", 30 | " if i > biggest:\n", 31 | " biggest = i\n", 32 | " return biggest\n", 33 | " \n", 34 | "maximum()" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 3, 40 | "id": "0bfec946", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "name": "stdout", 45 | "output_type": "stream", 46 | "text": [ 47 | "9\n" 48 | ] 49 | } 50 | ], 51 | "source": [ 52 | "def max_of_three( x, y,z ):\n", 53 | " if x > y and x > z:\n", 54 | " return x\n", 55 | " elif y>x and y> z:\n", 56 | " return y\n", 57 | " return z\n", 58 | "print(max_of_three(3,7,9))" 59 | ] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": 4, 64 | "id": "e6aca484", 65 | "metadata": {}, 66 | "outputs": [ 67 | { 68 | "name": "stdout", 69 | "output_type": "stream", 70 | "text": [ 71 | "25\n" 72 | ] 73 | } 74 | ], 75 | "source": [ 76 | "num_list = [2, 25, -96]\n", 77 | "\n", 78 | "max_num = num_list[0]\n", 79 | "for i in num_list:\n", 80 | " if i > max_num:\n", 81 | " max_num = i\n", 82 | "print(max_num)" 83 | ] 84 | } 85 | ], 86 | "metadata": { 87 | "kernelspec": { 88 | "display_name": "Python 3", 89 | "language": "python", 90 | "name": "python3" 91 | }, 92 | "language_info": { 93 | "codemirror_mode": { 94 | "name": "ipython", 95 | "version": 3 96 | }, 97 | "file_extension": ".py", 98 | "mimetype": "text/x-python", 99 | "name": "python", 100 | "nbconvert_exporter": "python", 101 | "pygments_lexer": "ipython3", 102 | "version": "3.8.8" 103 | } 104 | }, 105 | "nbformat": 4, 106 | "nbformat_minor": 5 107 | } 108 | -------------------------------------------------------------------------------- /Python-Addicts/Name_Age_Height_Tuples .ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "f42061c3", 6 | "metadata": {}, 7 | "source": [ 8 | "You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:\n", 9 | "1: Sort based on name;\n", 10 | "2: Then sort based on age;\n", 11 | "3: Then sort by score.\n", 12 | "The priority is that name > age > score.\n", 13 | "If the following tuples are given as input to the program:\n", 14 | "Tom,19,80\n", 15 | "John,20,90\n", 16 | "Jony,17,91\n", 17 | "Jony,17,93\n", 18 | "Json,21,85\n", 19 | "Then, the output of the program should be:\n", 20 | "[('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Json', '21', '85'), ('Tom', '19', '80')]" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 6, 26 | "id": "6bfaaf96", 27 | "metadata": {}, 28 | "outputs": [ 29 | { 30 | "name": "stdout", 31 | "output_type": "stream", 32 | "text": [ 33 | "[('John', 20, 90), ('Jony', 17, 91), ('Jony', 17, 93), ('Json', 21, 85), ('Tom', 19, 80)]\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "my_tuple = (\"Tom\",19,80), (\"John\",20,90), (\"Jony\",17,91), (\"Jony\",17,93), (\"Json\",21,85)\n", 39 | "sorted_tuple = tuple(sorted(my_tuple, key = lambda item: item[0]))\n", 40 | "print(list(sorted_tuple))" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "7c65df0b", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": null, 54 | "id": "6bcd378b", 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "id": "def9be69", 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "e97f32a9", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | } 75 | ], 76 | "metadata": { 77 | "kernelspec": { 78 | "display_name": "Python 3", 79 | "language": "python", 80 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 81 | }, 82 | "language_info": { 83 | "codemirror_mode": { 84 | "name": "ipython", 85 | "version": 3 86 | }, 87 | "file_extension": ".py", 88 | "mimetype": "text/x-python", 89 | "name": "python", 90 | "nbconvert_exporter": "python", 91 | "pygments_lexer": "ipython3", 92 | "version": "3.9.7" 93 | } 94 | }, 95 | "nbformat": 4, 96 | "nbformat_minor": 5 97 | } 98 | -------------------------------------------------------------------------------- /Python-Addicts/Number_Place_Value 09.08.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "87c07712", 6 | "metadata": {}, 7 | "source": [ 8 | "Create a function that takes a number num and returns each place value in the number. Examples num_split(39) ➞ [30, 9]\n", 9 | "\n", 10 | "num_split(-434) ➞ [-400, -30, -4]\n", 11 | "\n", 12 | "num_split(100) ➞ [100, 0, 0]" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 3, 18 | "id": "dc1c4509", 19 | "metadata": {}, 20 | "outputs": [ 21 | { 22 | "data": { 23 | "text/plain": [ 24 | "[300, 60, 8]" 25 | ] 26 | }, 27 | "execution_count": 3, 28 | "metadata": {}, 29 | "output_type": "execute_result" 30 | } 31 | ], 32 | "source": [ 33 | "num = 368\n", 34 | "lst = []\n", 35 | "a = 1\n", 36 | "\n", 37 | "if num < 0:\n", 38 | " a = -1\n", 39 | " \n", 40 | "for i in str(abs(num))[::-1]:\n", 41 | " b = int(i) * a\n", 42 | " a = a * 10\n", 43 | " lst.append(b) \n", 44 | "lst.reverse()\n", 45 | "lst" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 1, 51 | "id": "53b4769e", 52 | "metadata": {}, 53 | "outputs": [ 54 | { 55 | "data": { 56 | "text/plain": [ 57 | "[-100, -40, -5]" 58 | ] 59 | }, 60 | "execution_count": 1, 61 | "metadata": {}, 62 | "output_type": "execute_result" 63 | } 64 | ], 65 | "source": [ 66 | "def num_split(num):\n", 67 | " lst = []\n", 68 | " a = 1\n", 69 | " if num < 0:\n", 70 | " a = -1\n", 71 | " \n", 72 | " for i in str(abs(num))[::-1]:\n", 73 | " b = int(i) * a\n", 74 | " a *= 10\n", 75 | " lst.append(b)\n", 76 | " lst.reverse()\n", 77 | " return lst\n", 78 | "num_split(-145)" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "id": "a113aa3c", 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "id": "b6b92de9", 93 | "metadata": {}, 94 | "outputs": [], 95 | "source": [] 96 | } 97 | ], 98 | "metadata": { 99 | "kernelspec": { 100 | "display_name": "Python 3", 101 | "language": "python", 102 | "name": "python3" 103 | }, 104 | "language_info": { 105 | "codemirror_mode": { 106 | "name": "ipython", 107 | "version": 3 108 | }, 109 | "file_extension": ".py", 110 | "mimetype": "text/x-python", 111 | "name": "python", 112 | "nbconvert_exporter": "python", 113 | "pygments_lexer": "ipython3", 114 | "version": "3.8.8" 115 | } 116 | }, 117 | "nbformat": 4, 118 | "nbformat_minor": 5 119 | } 120 | -------------------------------------------------------------------------------- /Python-Addicts/Parantheses_InValidTrue.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "61757393", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "x = \"[[{({})}]({}))\"\n", 11 | "\n", 12 | "def isValid(s) :\n", 13 | " while \"()\" in s or \"{}\" in s or \"[]\" in s :\n", 14 | " s = s.replace(\"()\", \"\").replace(\"{}\", \"\").replace(\"[]\", \"\")\n", 15 | " return s == \"\"\n", 16 | "\n", 17 | "isValid(x)" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "19c43fc3", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": null, 31 | "id": "98db3eaa", 32 | "metadata": {}, 33 | "outputs": [], 34 | "source": [] 35 | } 36 | ], 37 | "metadata": { 38 | "kernelspec": { 39 | "display_name": "Python 3", 40 | "language": "python", 41 | "name": "python3" 42 | }, 43 | "language_info": { 44 | "codemirror_mode": { 45 | "name": "ipython", 46 | "version": 3 47 | }, 48 | "file_extension": ".py", 49 | "mimetype": "text/x-python", 50 | "name": "python", 51 | "nbconvert_exporter": "python", 52 | "pygments_lexer": "ipython3", 53 | "version": "3.8.8" 54 | } 55 | }, 56 | "nbformat": 4, 57 | "nbformat_minor": 5 58 | } 59 | -------------------------------------------------------------------------------- /Python-Addicts/Parrot_trouble_code_challenge 08.08.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "e737460a", 6 | "metadata": {}, 7 | "source": [ 8 | "We have a loud talking parrot. We are in trouble if the parrot is talking and \n", 9 | "the hour is before 6 or after 21. \n", 10 | "Define a function taking two parameters (talking and hour) to return True if we are in trouble. \n", 11 | "The argument to talking parameter can only be True or False whether it is talking or not. \n", 12 | "The argument to hour parameter should be the current hour time in the range of 0 to 23.\n", 13 | "\n", 14 | "For example:\n", 15 | "\n", 16 | "print(parrot_trouble(True, 5)) True \n", 17 | "print(parrot_trouble(True, 8)) False \n", 18 | "print(parrot_trouble(False, 22)) False\n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "id": "7adb9981", 25 | "metadata": {}, 26 | "outputs": [], 27 | "source": [ 28 | "def parrot_trouble(talking, hour):\n", 29 | " return True if talking and (hour<6 or hour>21) else False\n", 30 | "print(parrot_trouble(True, 5))\n", 31 | "print(parrot_trouble(True, 8))\n", 32 | "print(parrot_trouble(False, 22))" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": null, 38 | "id": "42bb53ea", 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "def parrot_trouble(talking, hour):\n", 43 | " if talking == True and hour > 21 and hour <=24:\n", 44 | " return True\n", 45 | " elif talking == True and hour < 6:\n", 46 | " return True\n", 47 | " else:\n", 48 | " return False\n", 49 | "\n", 50 | "print(parrot_trouble(True, 5))\n", 51 | "\n", 52 | "print(parrot_trouble(True, 8))\n", 53 | "\n", 54 | "print(parrot_trouble(False, 22))\n" 55 | ] 56 | } 57 | ], 58 | "metadata": { 59 | "kernelspec": { 60 | "display_name": "Python 3", 61 | "language": "python", 62 | "name": "python3" 63 | }, 64 | "language_info": { 65 | "codemirror_mode": { 66 | "name": "ipython", 67 | "version": 3 68 | }, 69 | "file_extension": ".py", 70 | "mimetype": "text/x-python", 71 | "name": "python", 72 | "nbconvert_exporter": "python", 73 | "pygments_lexer": "ipython3", 74 | "version": "3.8.8" 75 | } 76 | }, 77 | "nbformat": 4, 78 | "nbformat_minor": 5 79 | } 80 | -------------------------------------------------------------------------------- /Python-Addicts/Prime Factors.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "b43d5576", 6 | "metadata": {}, 7 | "source": [ 8 | "Create a function that returns a list containing the \n", 9 | "prime factors of whatever integer is passed to it.\n", 10 | "\n", 11 | "Examples\n", 12 | "prime_factors(20) ➞ [2, 2, 5]\n", 13 | "\n", 14 | "prime_factors(100) ➞ [2, 2, 5, 5]\n", 15 | "\n", 16 | "prime_factors(8912234) ➞ [2, 47, 94811]\n", 17 | "Notes\n", 18 | "Implement your solution using trial division.\n", 19 | "Your solution should not require recursion." 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 2, 25 | "id": "a2660a24", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "def prime_factors(n):\n", 30 | " lst = []\n", 31 | " for i in range(2,n+1):\n", 32 | " if n % i == 0:\n", 33 | " while n % i == 0:\n", 34 | " lst.append(i)\n", 35 | " n = n / i\n", 36 | " return lst" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": 1, 42 | "id": "b23e592d", 43 | "metadata": {}, 44 | "outputs": [ 45 | { 46 | "data": { 47 | "text/plain": [ 48 | "[2, 2, 5, 5]" 49 | ] 50 | }, 51 | "execution_count": 1, 52 | "metadata": {}, 53 | "output_type": "execute_result" 54 | } 55 | ], 56 | "source": [ 57 | "def prime_factors(num):\n", 58 | " lst = []\n", 59 | " while num != 1:\n", 60 | " for i in range(2, num + 1):\n", 61 | " if num % i == 0:\n", 62 | " num //= i\n", 63 | " lst.append(i)\n", 64 | " break\n", 65 | " return lst\n", 66 | "prime_factors(100)" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "id": "8a7db282", 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [] 76 | } 77 | ], 78 | "metadata": { 79 | "kernelspec": { 80 | "display_name": "Python 3", 81 | "language": "python", 82 | "name": "python3" 83 | }, 84 | "language_info": { 85 | "codemirror_mode": { 86 | "name": "ipython", 87 | "version": 3 88 | }, 89 | "file_extension": ".py", 90 | "mimetype": "text/x-python", 91 | "name": "python", 92 | "nbconvert_exporter": "python", 93 | "pygments_lexer": "ipython3", 94 | "version": "3.8.8" 95 | } 96 | }, 97 | "nbformat": 4, 98 | "nbformat_minor": 5 99 | } 100 | -------------------------------------------------------------------------------- /Python-Addicts/Prime_Number_Factors 09.08.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "03960c0d", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Create a function that returns a list containing the \n", 11 | "prime factors of whatever integer is passed to it. \n", 12 | "Examples prime_factors(20) ➞ [2, 2, 5] \n", 13 | "prime_factors(100) ➞ [2, 2, 5, 5] \n", 14 | "prime_factors(8912234) ➞ [2, 47, 94811]" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "id": "c88e4fc0", 21 | "metadata": {}, 22 | "outputs": [ 23 | { 24 | "data": { 25 | "text/plain": [ 26 | "[2, 2, 5, 5]" 27 | ] 28 | }, 29 | "execution_count": 1, 30 | "metadata": {}, 31 | "output_type": "execute_result" 32 | } 33 | ], 34 | "source": [ 35 | "def prime_factors(num):\n", 36 | " lst = []\n", 37 | " while num != 1:\n", 38 | " for i in range(2, num + 1):\n", 39 | " if num % i == 0:\n", 40 | " num //= i\n", 41 | " lst.append(i)\n", 42 | " break\n", 43 | " return lst\n", 44 | "prime_factors(100)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "32968f39", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "248d7fe9", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "174e4ed8", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.8.8" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /Python-Addicts/README.md: -------------------------------------------------------------------------------- 1 | # Phyton-Addicts 2 | Phython addicts kanalinda sorulan sorular ve cozumlerinden olusmaktadir. 3 | -------------------------------------------------------------------------------- /Python-Addicts/Recursion_Function.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "79cc1ae8", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Given a number N. Find Sum of 1 to N. Using Recursion Function.İnput =5 ,Output=15" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 1, 16 | "id": "bb740337", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "15\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "def sum_num(num):\n", 29 | " if num == 1:\n", 30 | " return 1\n", 31 | "\n", 32 | " return num + sum_num(num-1)\n", 33 | "\n", 34 | "print(sum_num(5))" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": null, 40 | "id": "8dc5bd08", 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [] 44 | } 45 | ], 46 | "metadata": { 47 | "kernelspec": { 48 | "display_name": "Python 3", 49 | "language": "python", 50 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 51 | }, 52 | "language_info": { 53 | "codemirror_mode": { 54 | "name": "ipython", 55 | "version": 3 56 | }, 57 | "file_extension": ".py", 58 | "mimetype": "text/x-python", 59 | "name": "python", 60 | "nbconvert_exporter": "python", 61 | "pygments_lexer": "ipython3", 62 | "version": "3.9.7" 63 | } 64 | }, 65 | "nbformat": 4, 66 | "nbformat_minor": 5 67 | } 68 | -------------------------------------------------------------------------------- /Python-Addicts/Remove_Last_Character .ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "56e282da", 6 | "metadata": {}, 7 | "source": [ 8 | "Remove last character in list of strings: given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"] expected output : ['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 2, 14 | "id": "7db68b36", 15 | "metadata": {}, 16 | "outputs": [ 17 | { 18 | "name": "stdout", 19 | "output_type": "stream", 20 | "text": [ 21 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 22 | ] 23 | } 24 | ], 25 | "source": [ 26 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"]\n", 27 | "print(list(map(lambda i:i[:-1],given_list)))" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 4, 33 | "id": "50518b0e", 34 | "metadata": {}, 35 | "outputs": [ 36 | { 37 | "data": { 38 | "text/plain": [ 39 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']" 40 | ] 41 | }, 42 | "execution_count": 4, 43 | "metadata": {}, 44 | "output_type": "execute_result" 45 | } 46 | ], 47 | "source": [ 48 | "def last_char(array):\n", 49 | " return [\"\".join(i[:-1]) for i in array]\n", 50 | "last_char([\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"])" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 5, 56 | "id": "ba9ead44", 57 | "metadata": {}, 58 | "outputs": [ 59 | { 60 | "name": "stdout", 61 | "output_type": "stream", 62 | "text": [ 63 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 64 | ] 65 | } 66 | ], 67 | "source": [ 68 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"]\n", 69 | "a=[i[:-1] for i in given_list]\n", 70 | "print(a)" 71 | ] 72 | } 73 | ], 74 | "metadata": { 75 | "kernelspec": { 76 | "display_name": "Python 3", 77 | "language": "python", 78 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 79 | }, 80 | "language_info": { 81 | "codemirror_mode": { 82 | "name": "ipython", 83 | "version": 3 84 | }, 85 | "file_extension": ".py", 86 | "mimetype": "text/x-python", 87 | "name": "python", 88 | "nbconvert_exporter": "python", 89 | "pygments_lexer": "ipython3", 90 | "version": "3.9.7" 91 | } 92 | }, 93 | "nbformat": 4, 94 | "nbformat_minor": 5 95 | } 96 | -------------------------------------------------------------------------------- /Python-Addicts/Remove_Last_Character.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "e8a61d8f", 6 | "metadata": {}, 7 | "source": [ 8 | "Remove last character in list of strings: \n", 9 | " given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"] \n", 10 | " expected output : ['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 2, 16 | "id": "c60002e2", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"] \n", 29 | "print(list(map(lambda i:i[:-1],given_list)))" 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": 3, 35 | "id": "6a0ca116", 36 | "metadata": {}, 37 | "outputs": [ 38 | { 39 | "name": "stdout", 40 | "output_type": "stream", 41 | "text": [ 42 | "['Lesson', 'Word', 'Python', 'Programer', 'Clarusway']\n" 43 | ] 44 | } 45 | ], 46 | "source": [ 47 | "given_list = [\"Lessons\", \"Words\", \"Pythons\", \"Programers\",\"Clarusways\"]\n", 48 | "a=[i[:-1] for i in given_list]\n", 49 | "print(a)" 50 | ] 51 | } 52 | ], 53 | "metadata": { 54 | "kernelspec": { 55 | "display_name": "Python 3", 56 | "language": "python", 57 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 58 | }, 59 | "language_info": { 60 | "codemirror_mode": { 61 | "name": "ipython", 62 | "version": 3 63 | }, 64 | "file_extension": ".py", 65 | "mimetype": "text/x-python", 66 | "name": "python", 67 | "nbconvert_exporter": "python", 68 | "pygments_lexer": "ipython3", 69 | "version": "3.9.7" 70 | } 71 | }, 72 | "nbformat": 4, 73 | "nbformat_minor": 5 74 | } 75 | -------------------------------------------------------------------------------- /Python-Addicts/Square_Pattern.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3a633331", 6 | "metadata": {}, 7 | "source": [ 8 | "Write your solutions. Print square pattern with alphabet symbols: output :\n", 9 | "A A A A A A A \n", 10 | "B B B B B B B \n", 11 | "C C C C C C C \n", 12 | "D D D D D D D \n", 13 | "E E E E E E E \n", 14 | "F F F F F F F \n", 15 | "G G G G G G G " 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": null, 21 | "id": "575c380c", 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "def square_pattern(n, k):\n", 26 | "\n", 27 | " for i in range(ord(n), ord(n)+k):\n", 28 | " for j in range(k):\n", 29 | " print(chr(i), end= \" \")\n", 30 | " print()\n", 31 | "\n", 32 | "square_pattern(\"A\", 7)" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": null, 38 | "id": "5202e431", 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "def kelime(n,k):\n", 43 | " l=\"\"\n", 44 | " t,z=ord(n),0\n", 45 | " while k:\n", 46 | " l+=(chr(t)+\" \")*k+\"\\n\"\n", 47 | " t+=1 \n", 48 | " z+=1\n", 49 | " if z==k:\n", 50 | " break\n", 51 | " return l\n", 52 | "print(kelime(\"K\",7))" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 1, 58 | "id": "5f9de12b", 59 | "metadata": {}, 60 | "outputs": [ 61 | { 62 | "name": "stdout", 63 | "output_type": "stream", 64 | "text": [ 65 | "Enter No Of Rows:7\n", 66 | "A A A A A A A \n", 67 | "B B B B B B B \n", 68 | "C C C C C C C \n", 69 | "D D D D D D D \n", 70 | "E E E E E E E \n", 71 | "F F F F F F F \n", 72 | "G G G G G G G \n" 73 | ] 74 | } 75 | ], 76 | "source": [ 77 | "n=int(input('Enter No Of Rows:'))\n", 78 | "for i in range(n):\n", 79 | " print((chr(65+i)+' ')*n)" 80 | ] 81 | } 82 | ], 83 | "metadata": { 84 | "kernelspec": { 85 | "display_name": "Python 3", 86 | "language": "python", 87 | "name": "pythonjvsc74a57bd0aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" 88 | }, 89 | "language_info": { 90 | "codemirror_mode": { 91 | "name": "ipython", 92 | "version": 3 93 | }, 94 | "file_extension": ".py", 95 | "mimetype": "text/x-python", 96 | "name": "python", 97 | "nbconvert_exporter": "python", 98 | "pygments_lexer": "ipython3", 99 | "version": "3.9.7" 100 | } 101 | }, 102 | "nbformat": 4, 103 | "nbformat_minor": 5 104 | } 105 | -------------------------------------------------------------------------------- /Python-Addicts/Sum_of_Nested_List.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "7ae66a34", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "80\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "def liste(n):\n", 19 | " t=0\n", 20 | " for i in n:\n", 21 | " for j in i:\n", 22 | " t+=j\n", 23 | " return t\n", 24 | "print(liste([[1,4,5],[7,3],[4],[46,7,3]]))" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": 3, 30 | "id": "0fafcf95", 31 | "metadata": {}, 32 | "outputs": [ 33 | { 34 | "name": "stdout", 35 | "output_type": "stream", 36 | "text": [ 37 | "80\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "test_list = [[1,4,5], [7,3],[4],[46,7,3]]\n", 43 | "summ = 0\n", 44 | "summ = sum([summ + sum(i) for i in test_list])\n", 45 | "print(summ)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 4, 51 | "id": "0fd68a4f", 52 | "metadata": {}, 53 | "outputs": [ 54 | { 55 | "name": "stdout", 56 | "output_type": "stream", 57 | "text": [ 58 | "80\n" 59 | ] 60 | } 61 | ], 62 | "source": [ 63 | "result = sum([x for x in test_list for x in x])\n", 64 | "print(result)" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 7, 70 | "id": "70b5cc8c", 71 | "metadata": {}, 72 | "outputs": [ 73 | { 74 | "data": { 75 | "text/plain": [ 76 | "59" 77 | ] 78 | }, 79 | "execution_count": 7, 80 | "metadata": {}, 81 | "output_type": "execute_result" 82 | } 83 | ], 84 | "source": [ 85 | "test_list = [[2,4,5], [7,8,9], [0,2,4], [5,5,8]]\n", 86 | "\n", 87 | "result = sum(list(map(lambda x : sum(x), test_list)))\n", 88 | "result" 89 | ] 90 | }, 91 | { 92 | "cell_type": "code", 93 | "execution_count": null, 94 | "id": "a332f813", 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [] 98 | } 99 | ], 100 | "metadata": { 101 | "kernelspec": { 102 | "display_name": "Python 3", 103 | "language": "python", 104 | "name": "python3" 105 | }, 106 | "language_info": { 107 | "codemirror_mode": { 108 | "name": "ipython", 109 | "version": 3 110 | }, 111 | "file_extension": ".py", 112 | "mimetype": "text/x-python", 113 | "name": "python", 114 | "nbconvert_exporter": "python", 115 | "pygments_lexer": "ipython3", 116 | "version": "3.8.8" 117 | } 118 | }, 119 | "nbformat": 4, 120 | "nbformat_minor": 5 121 | } 122 | -------------------------------------------------------------------------------- /Python-Addicts/Tersten_Yazdirma.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "eb11a188", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Bir foksiyon tanımlayın ve foksiyonun sonucunda girilen her kelimeyi kendi içinde\n", 11 | "tersten yazdırın: given str =\"My Name is Muhammet\" expected_out_put: 'yM emaN si temmahuM'" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 9, 17 | "id": "66450fde", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "yM emaN si temmahuM \n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "string =\"My Name is Muhammet\"\n", 30 | "lst = string.split(\" \")\n", 31 | "lst_new = \"\"\n", 32 | "for i in lst:\n", 33 | " lst_new += i[::-1] + \" \" \n", 34 | "print(lst_new)" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 12, 40 | "id": "9c796f11", 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "def reverse_word(sentence) :\n", 45 | " wordlst = sentence.split(\" \")\n", 46 | " new_sentence = \"\"\n", 47 | " for i in wordlst :\n", 48 | " new_sentence += i[::-1] \n", 49 | " new_sentence += \" \"\n", 50 | " \n", 51 | " \n", 52 | " return new_sentence" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 13, 58 | "id": "8e3aab5c", 59 | "metadata": {}, 60 | "outputs": [ 61 | { 62 | "data": { 63 | "text/plain": [ 64 | "'yM emaN si temmahuM'" 65 | ] 66 | }, 67 | "execution_count": 13, 68 | "metadata": {}, 69 | "output_type": "execute_result" 70 | } 71 | ], 72 | "source": [ 73 | "def reverse(text):\n", 74 | " new = text.split(' ')\n", 75 | " lst = [i[::-1] for i in new]\n", 76 | " string= \" \".join(lst)\n", 77 | " return string\n", 78 | "reverse(\"My Name is Muhammet\")" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "id": "9c549d52", 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | } 89 | ], 90 | "metadata": { 91 | "kernelspec": { 92 | "display_name": "Python 3", 93 | "language": "python", 94 | "name": "python3" 95 | }, 96 | "language_info": { 97 | "codemirror_mode": { 98 | "name": "ipython", 99 | "version": 3 100 | }, 101 | "file_extension": ".py", 102 | "mimetype": "text/x-python", 103 | "name": "python", 104 | "nbconvert_exporter": "python", 105 | "pygments_lexer": "ipython3", 106 | "version": "3.8.8" 107 | } 108 | }, 109 | "nbformat": 4, 110 | "nbformat_minor": 5 111 | } 112 | -------------------------------------------------------------------------------- /Python-Addicts/Tersten_Yazdirma2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3ee405fd", 6 | "metadata": {}, 7 | "source": [ 8 | "Bir foksiyon tanımlayın ve foksiyonun sonucunda girilen her \n", 9 | "kelimeyi kendi içinde tersten yazdırın: \n", 10 | "given str =\"My Name is Muhammet\" expected_out_put: 'yM emaN si temmahuM'" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 4, 16 | "id": "bc107b52", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "data": { 21 | "text/plain": [ 22 | "'yM emaN si temmahuM'" 23 | ] 24 | }, 25 | "execution_count": 4, 26 | "metadata": {}, 27 | "output_type": "execute_result" 28 | } 29 | ], 30 | "source": [ 31 | "def reversewords(sentence) :\n", 32 | " wordslists = sentence.split(\" \")\n", 33 | " new_sentence = \"\"\n", 34 | " for i in wordslists :\n", 35 | " new_sentence += i[::-1] \n", 36 | " new_sentence += \" \"\n", 37 | " \n", 38 | " \n", 39 | " return new_sentence[:len(sentence)]\n", 40 | "reversewords(\"My Name is Muhammet\")" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": 5, 46 | "id": "b2ed3710", 47 | "metadata": {}, 48 | "outputs": [ 49 | { 50 | "data": { 51 | "text/plain": [ 52 | "['Mike', 'Emme', 'Kelly', 'Brad']" 53 | ] 54 | }, 55 | "execution_count": 5, 56 | "metadata": {}, 57 | "output_type": "execute_result" 58 | } 59 | ], 60 | "source": [ 61 | "list1= ['Mike', \"\", 'Emme', \"\", 'Kelly', \"\", 'Brad']\n", 62 | "\n", 63 | "result = list(filter(lambda x: x != \"\", list1))\n", 64 | "result" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "235084ba", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "id": "6601415c", 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [] 82 | } 83 | ], 84 | "metadata": { 85 | "kernelspec": { 86 | "display_name": "Python 3", 87 | "language": "python", 88 | "name": "python3" 89 | }, 90 | "language_info": { 91 | "codemirror_mode": { 92 | "name": "ipython", 93 | "version": 3 94 | }, 95 | "file_extension": ".py", 96 | "mimetype": "text/x-python", 97 | "name": "python", 98 | "nbconvert_exporter": "python", 99 | "pygments_lexer": "ipython3", 100 | "version": "3.8.8" 101 | } 102 | }, 103 | "nbformat": 4, 104 | "nbformat_minor": 5 105 | } 106 | -------------------------------------------------------------------------------- /Python-Addicts/Triangle_Challenge.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "77d8db81", 6 | "metadata": {}, 7 | "source": [ 8 | "Write a Python program to check a triangle is equilateral, isosceles or scalene.\n", 9 | "Note :\n", 10 | "An equilateral triangle is a triangle in which all three sides are equal.\n", 11 | "A scalene triangle is a triangle that has three unequal sides.\n", 12 | "An isosceles triangle is a triangle with (at least) two equal sides.\n", 13 | "Sample Output:\n", 14 | "x: 6\n", 15 | "y:8\n", 16 | "z:12\n", 17 | "Scalene triangle\n", 18 | "Bu soruyu biraz uğraşılırsa herkes çözebilir " 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 1, 24 | "id": "290d6384", 25 | "metadata": {}, 26 | "outputs": [ 27 | { 28 | "name": "stdout", 29 | "output_type": "stream", 30 | "text": [ 31 | "sayı giriniz : 6\n", 32 | "sayı giriniz : 8\n", 33 | "sayı giriniz : 12\n", 34 | "scalena üçgen\n" 35 | ] 36 | } 37 | ], 38 | "source": [ 39 | "x=int(input(\"sayı giriniz : \"))\n", 40 | "y=int(input(\"sayı giriniz : \"))\n", 41 | "z=int(input(\"sayı giriniz : \"))\n", 42 | "if x==y and x==z and y==z:\n", 43 | " k=\"eşkenar üçgen\"\n", 44 | "elif x==y or x==z or y==z :\n", 45 | " k=\"ikizkenar üçgen\"\n", 46 | "else:\n", 47 | " k=\"scalena üçgen\"\n", 48 | "print(k)" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": null, 54 | "id": "d6b69802", 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "id": "5fd8e15f", 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "7f4ef9cb", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "id": "c4ca5bd0", 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [] 82 | } 83 | ], 84 | "metadata": { 85 | "kernelspec": { 86 | "display_name": "Python 3", 87 | "language": "python", 88 | "name": "python3" 89 | }, 90 | "language_info": { 91 | "codemirror_mode": { 92 | "name": "ipython", 93 | "version": 3 94 | }, 95 | "file_extension": ".py", 96 | "mimetype": "text/x-python", 97 | "name": "python", 98 | "nbconvert_exporter": "python", 99 | "pygments_lexer": "ipython3", 100 | "version": "3.8.8" 101 | } 102 | }, 103 | "nbformat": 4, 104 | "nbformat_minor": 5 105 | } 106 | -------------------------------------------------------------------------------- /Python-Addicts/rumi.txt: -------------------------------------------------------------------------------- 1 | I want to sign 2 | Like a birds sing, 3 | Not worry about 4 | Who ears or 5 | That they think. -------------------------------------------------------------------------------- /Python-Addicts/sortlist_without.sort()_method.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "6207af0a", 6 | "metadata": {}, 7 | "source": [ 8 | "Write a Python code to sort the list at below without using .sort() method of list. \n", 9 | "elements of list = [999, 333, 2, 8982, 12, 45, 77, 99, 11] \n", 10 | "Expected output: [2, 11, 12, 45, 77, 99, 333, 999, 8982]" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "2bda915c", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "a = [999, 333, 2, 8982, 12, 45, 77, 99, 11]\n", 21 | "b = []\n", 22 | "for i in range(len(a)):\n", 23 | " maximum = max(a)\n", 24 | " b.append(maximum)\n", 25 | " a.remove(maximum)\n", 26 | " b.reverse()\n", 27 | "print(b)" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "id": "fa78b493", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "elements_list = [999, 333, 2, 8982, 12, 45, 77, 99, 11]\n", 38 | "new_list = []\n", 39 | "i = 1\n", 40 | "loop = len(elements_list)\n", 41 | "while i <= loop:\n", 42 | " min1 = min(elements_list)\n", 43 | " new_list.append(min1)\n", 44 | " elements_list.remove(min1)\n", 45 | " i += 1\n", 46 | "print(new_list)" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": null, 52 | "id": "e9266511", 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": null, 60 | "id": "e7945a40", 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": null, 68 | "id": "12b04a5c", 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "id": "e0f62c3a", 77 | "metadata": {}, 78 | "outputs": [], 79 | "source": [] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "id": "472fb888", 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | } 89 | ], 90 | "metadata": { 91 | "kernelspec": { 92 | "display_name": "Python 3", 93 | "language": "python", 94 | "name": "python3" 95 | }, 96 | "language_info": { 97 | "codemirror_mode": { 98 | "name": "ipython", 99 | "version": 3 100 | }, 101 | "file_extension": ".py", 102 | "mimetype": "text/x-python", 103 | "name": "python", 104 | "nbconvert_exporter": "python", 105 | "pygments_lexer": "ipython3", 106 | "version": "3.8.8" 107 | } 108 | }, 109 | "nbformat": 4, 110 | "nbformat_minor": 5 111 | } 112 | -------------------------------------------------------------------------------- /Python-Assignments/.ipynb_checkpoints/Assignment_Fibonacci_Numbers-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 13, 6 | "id": "070b0170", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "fibonacci sayıları : [1, 2, 3, 5, 8, 13, 21, 34, 55]\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "x, y, z = 0, 1, 2\n", 19 | "fibonacci=[]\n", 20 | "while z < 55:\n", 21 | " z = x + y\n", 22 | " x = y\n", 23 | " y = z\n", 24 | " fibonacci.append(z)\n", 25 | "print(\"fibonacci sayıları :\", fibonacci)" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 3, 31 | "id": "c09a7201", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "data": { 36 | "text/plain": [ 37 | "[1, 2, 3, 5, 8, 13, 21, 34, 55]" 38 | ] 39 | }, 40 | "execution_count": 3, 41 | "metadata": {}, 42 | "output_type": "execute_result" 43 | } 44 | ], 45 | "source": [ 46 | "def fib(n): \n", 47 | " result = []\n", 48 | " a, b = 1, 2\n", 49 | " while a < n+1:\n", 50 | " result.append(a)\n", 51 | " a, b = b, a+b\n", 52 | " return result\n", 53 | " \n", 54 | "fib(55)" 55 | ] 56 | } 57 | ], 58 | "metadata": { 59 | "kernelspec": { 60 | "display_name": "Python 3", 61 | "language": "python", 62 | "name": "python3" 63 | }, 64 | "language_info": { 65 | "codemirror_mode": { 66 | "name": "ipython", 67 | "version": 3 68 | }, 69 | "file_extension": ".py", 70 | "mimetype": "text/x-python", 71 | "name": "python", 72 | "nbconvert_exporter": "python", 73 | "pygments_lexer": "ipython3", 74 | "version": "3.8.8" 75 | } 76 | }, 77 | "nbformat": 4, 78 | "nbformat_minor": 5 79 | } 80 | -------------------------------------------------------------------------------- /Python-Assignments/.ipynb_checkpoints/Assignment_Find Minimum_and_Sum_Numbers-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 3, 6 | "id": "d4d010e3", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "5\n", 14 | "-9\n", 15 | "-100\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "def my_min(*nums):\n", 21 | " return min(list(nums))\n", 22 | "\n", 23 | "print(my_min(5,6,7))\n", 24 | "print(my_min(3,8,-9,0,12,1.2))\n", 25 | "print(my_min(-100))" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 4, 31 | "id": "bf6c9871", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "name": "stdout", 36 | "output_type": "stream", 37 | "text": [ 38 | "12\n", 39 | "16\n", 40 | "60\n" 41 | ] 42 | } 43 | ], 44 | "source": [ 45 | "def my_sum(*nums):\n", 46 | " return sum(list(nums))\n", 47 | "\n", 48 | "print(my_sum(9, 1, 3, 0, -1))\n", 49 | "print(my_sum(5, 7, 4))\n", 50 | "print(my_sum(10, -20, 30, 40))" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "id": "1a222201", 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "id": "8df8a713", 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "id": "bca73647", 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [] 76 | } 77 | ], 78 | "metadata": { 79 | "kernelspec": { 80 | "display_name": "Python 3", 81 | "language": "python", 82 | "name": "python3" 83 | }, 84 | "language_info": { 85 | "codemirror_mode": { 86 | "name": "ipython", 87 | "version": 3 88 | }, 89 | "file_extension": ".py", 90 | "mimetype": "text/x-python", 91 | "name": "python", 92 | "nbconvert_exporter": "python", 93 | "pygments_lexer": "ipython3", 94 | "version": "3.8.8" 95 | } 96 | }, 97 | "nbformat": 4, 98 | "nbformat_minor": 5 99 | } 100 | -------------------------------------------------------------------------------- /Python-Assignments/.ipynb_checkpoints/Assignment_Letters_Count-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "514c047c", 6 | "metadata": {}, 7 | "source": [ 8 | "Write your Python codes on any IDE and push it up to your GitHub repository, \n", 9 | "then submit your GitHub page address link in addition to your codes (answer) as a plain text. \n", 10 | "Task:\n", 11 | "\n", 12 | "Count the number of each letter in a sentence.\n", 13 | "The department you work for undertook a project construction \n", 14 | "that makes word / text analysis. You are asked to calculate the \n", 15 | "number of letters or any chars in the sentences entered under this project.\n", 16 | "Write a Python program that;\n", 17 | "takes a sentence from the user,\n", 18 | "counts the number of each letter of the sentence,\n", 19 | "collects the letters/chars as a key and the counted numbers as a value in a dictionary.\n", 20 | "\n", 21 | "Examples\n", 22 | "Sample inputs\tOutputs\n", 23 | "hippo runs to us!\t\n", 24 | "{'s': 2, 'r': 1, 't': 1, 'h': 1, 'n': 1, \n", 25 | "'i': 1, 'u': 2, 'o': 2, 'p': 2, ' ': 3, '!': 1}\n", 26 | "\n", 27 | "\n", 28 | "Note that; this question is famous on the web, so that do it yourself \n", 29 | "to get more benefits from it. By the way, Do not use try - except block." 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": null, 35 | "id": "d41cc12c", 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "hippo runs to us!\n", 40 | "{'s': 2, 'r': 1, 't': 1, 'h': 1, 'n': 1, \n", 41 | "'i': 1, 'u': 2, 'o': 2, 'p': 2, ' ': 3, '!': 1}" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 4, 47 | "id": "f89cb998", 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "name": "stdout", 52 | "output_type": "stream", 53 | "text": [ 54 | "Enter your sentence: hippo runs to us!\n", 55 | "{'h': 1, 'i': 1, 'p': 2, 'o': 2, ' ': 3, 'r': 1, 'u': 2, 'n': 1, 's': 2, 't': 1, '!': 1}\n" 56 | ] 57 | } 58 | ], 59 | "source": [ 60 | "text = input(\"Enter your sentence: \").lower()\n", 61 | "counts = {}\n", 62 | "for i in text:\n", 63 | " if i not in counts:\n", 64 | " counts[i] = 1\n", 65 | " else:\n", 66 | " counts[i] += 1\n", 67 | "print(counts)" 68 | ] 69 | } 70 | ], 71 | "metadata": { 72 | "kernelspec": { 73 | "display_name": "Python 3", 74 | "language": "python", 75 | "name": "python3" 76 | }, 77 | "language_info": { 78 | "codemirror_mode": { 79 | "name": "ipython", 80 | "version": 3 81 | }, 82 | "file_extension": ".py", 83 | "mimetype": "text/x-python", 84 | "name": "python", 85 | "nbconvert_exporter": "python", 86 | "pygments_lexer": "ipython3", 87 | "version": "3.8.8" 88 | } 89 | }, 90 | "nbformat": 4, 91 | "nbformat_minor": 5 92 | } 93 | -------------------------------------------------------------------------------- /Python-Assignments/.ipynb_checkpoints/Assignment_Negative_Meaning-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "04171d7e", 6 | "metadata": {}, 7 | "source": [ 8 | "Define a function to take a word and return negative meaning.\n", 9 | "Given a word, return a new word where \"not \" \n", 10 | "has been added to the front. However, if the word \n", 11 | "already begins with \"not\", return the string unchanged.\n", 12 | "\n", 13 | "For example:\n", 14 | "\n", 15 | "Test\tResult\n", 16 | "print(not_string('sugar'))\n", 17 | "not sugar\n", 18 | "print(not_string('x'))\n", 19 | "not x\n", 20 | "print(not_string('not bad'))\n", 21 | "not bad" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 26, 27 | "id": "7c8aa7ce", 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "name": "stdout", 32 | "output_type": "stream", 33 | "text": [ 34 | "not sugar\n", 35 | "not free\n", 36 | "not x\n", 37 | "not bad\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "def not_string(word):\n", 43 | " if \"not\" in word:\n", 44 | " return word\n", 45 | " else:\n", 46 | " word = \"not \" + word\n", 47 | " return word \n", 48 | "\n", 49 | "\n", 50 | "print(not_string(\"sugar\"))\n", 51 | "print(not_string('free'))\n", 52 | "print(not_string('x'))\n", 53 | "print(not_string('not bad')) " 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 27, 59 | "id": "77aae755", 60 | "metadata": {}, 61 | "outputs": [ 62 | { 63 | "name": "stdout", 64 | "output_type": "stream", 65 | "text": [ 66 | "not sugar\n", 67 | "not free\n", 68 | "not x\n", 69 | "not bad\n" 70 | ] 71 | } 72 | ], 73 | "source": [ 74 | "def not_string(word):\n", 75 | " if not \"not\" in word:\n", 76 | " return \"not \" + word\n", 77 | " else:\n", 78 | " return word\n", 79 | "\n", 80 | "\n", 81 | "print(not_string(\"sugar\"))\n", 82 | "print(not_string('free'))\n", 83 | "print(not_string('x'))\n", 84 | "print(not_string('not bad')) " 85 | ] 86 | } 87 | ], 88 | "metadata": { 89 | "kernelspec": { 90 | "display_name": "Python 3", 91 | "language": "python", 92 | "name": "python3" 93 | }, 94 | "language_info": { 95 | "codemirror_mode": { 96 | "name": "ipython", 97 | "version": 3 98 | }, 99 | "file_extension": ".py", 100 | "mimetype": "text/x-python", 101 | "name": "python", 102 | "nbconvert_exporter": "python", 103 | "pygments_lexer": "ipython3", 104 | "version": "3.8.8" 105 | } 106 | }, 107 | "nbformat": 4, 108 | "nbformat_minor": 5 109 | } 110 | -------------------------------------------------------------------------------- /Python-Assignments/.ipynb_checkpoints/Assignment_Prime_Number-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 64, 6 | "id": "7648d309", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter a number: 1973\n", 14 | "1973 is a prime number\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "number = int(input(\"Enter a number: \"))\n", 20 | "if all (number % i != 0 for i in range(2, number)):\n", 21 | " print(number,\"is a prime number\") \n", 22 | "else:\n", 23 | " print(number,\"is not a prime number\") " 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 2, 29 | "id": "e0a01146", 30 | "metadata": {}, 31 | "outputs": [ 32 | { 33 | "name": "stdout", 34 | "output_type": "stream", 35 | "text": [ 36 | "Enter a number to check if it is a prime number.12\n", 37 | "12 is not a prime number.\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "n = int(input(\"Enter a number to check if it is a prime number.\"))\n", 43 | "count = 0\n", 44 | "for i in range(1, n+1) :\n", 45 | " if n % i == 0 :\n", 46 | " count += 1\n", 47 | "if (n == 0) or (n == 1) or (count >=3) :\n", 48 | " print(n, \"is not a prime number.\")\n", 49 | "else:\n", 50 | " print(n, \"is a prime number\")" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "id": "461d3aa3", 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "id": "26a6171f", 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [] 68 | } 69 | ], 70 | "metadata": { 71 | "kernelspec": { 72 | "display_name": "Python 3", 73 | "language": "python", 74 | "name": "python3" 75 | }, 76 | "language_info": { 77 | "codemirror_mode": { 78 | "name": "ipython", 79 | "version": 3 80 | }, 81 | "file_extension": ".py", 82 | "mimetype": "text/x-python", 83 | "name": "python", 84 | "nbconvert_exporter": "python", 85 | "pygments_lexer": "ipython3", 86 | "version": "3.8.8" 87 | } 88 | }, 89 | "nbformat": 4, 90 | "nbformat_minor": 5 91 | } 92 | -------------------------------------------------------------------------------- /Python-Assignments/.ipynb_checkpoints/Assignment_Your_Factorial-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "6b53603f", 6 | "metadata": {}, 7 | "source": [ 8 | "Define a function named my_fact to calculate factorial of the given number. \n", 9 | "Given a non-negative integer return the factorial of the integer.\n", 10 | "\n", 11 | "(Example: The factorial of 5 is: 5*4*3*2*1 = 120 and factorial of 0 is: 1)" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 3, 17 | "id": "e4260bf4", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "6\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "def my_fact(num):\n", 30 | " fak = 1\n", 31 | " for i in range(1,num+1):\n", 32 | " fak *=i\n", 33 | " return fak\n", 34 | "print(my_fact(3))" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 4, 40 | "id": "98e60ec6", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "name": "stdout", 45 | "output_type": "stream", 46 | "text": [ 47 | "6\n" 48 | ] 49 | } 50 | ], 51 | "source": [ 52 | "def my_fact(n):\n", 53 | " fak = 1\n", 54 | " for i in range(1,n+1):\n", 55 | " fak *=i\n", 56 | " return fak\n", 57 | "print(my_fact(3))" 58 | ] 59 | } 60 | ], 61 | "metadata": { 62 | "kernelspec": { 63 | "display_name": "Python 3", 64 | "language": "python", 65 | "name": "python3" 66 | }, 67 | "language_info": { 68 | "codemirror_mode": { 69 | "name": "ipython", 70 | "version": 3 71 | }, 72 | "file_extension": ".py", 73 | "mimetype": "text/x-python", 74 | "name": "python", 75 | "nbconvert_exporter": "python", 76 | "pygments_lexer": "ipython3", 77 | "version": "3.8.8" 78 | } 79 | }, 80 | "nbformat": 4, 81 | "nbformat_minor": 5 82 | } 83 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Comfortable_Words.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 3, 6 | "id": "7be2bcf9", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Bir kelime giriniz: clarus\n" 14 | ] 15 | }, 16 | { 17 | "data": { 18 | "text/plain": [ 19 | "'True (uses both hand fingers)'" 20 | ] 21 | }, 22 | "execution_count": 3, 23 | "metadata": {}, 24 | "output_type": "execute_result" 25 | } 26 | ], 27 | "source": [ 28 | "word = set(input(\"Bir kelime giriniz: \"))\n", 29 | "\n", 30 | "a = set([\"q\", \"w\", \"e\", \"r\", \"t\", \"a\", \"s\", \"d\", \"f\", \"g\", \"z\", \"x\", \"c\", \"v\", \"b\"])\n", 31 | "b = set([\"y\", \"u\", \"o\", \"p\", \"i\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\"])\n", 32 | "\n", 33 | "right = bool(word.intersection(b)) * \"False (uses only right-hand fingers)\"\n", 34 | "\n", 35 | "left = bool(word.intersection(a)) * \"False (uses only left-hand fingers)\"\n", 36 | "\n", 37 | "both = bool(right and left) * \"True (uses both hand fingers)\"\n", 38 | "\n", 39 | "both or right or left" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "517651f4", 46 | "metadata": {}, 47 | "outputs": [], 48 | "source": [ 49 | "word = set(input(\"Bir kelime giriniz: \"))\n", 50 | "\n", 51 | "a = set([\"q\", \"w\", \"e\", \"r\", \"t\", \"a\", \"s\", \"d\", \"f\", \"g\", \"z\", \"x\", \"c\", \"v\", \"b\"])\n", 52 | "\n", 53 | "b = set([\"y\", \"u\", \"o\", \"p\", \"i\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\"])\n", 54 | "\n", 55 | "right = bool(word.intersection(b)) # * \"False(uses only right-hand fingers)\"\n", 56 | "\n", 57 | "left = bool(word.intersection(a)) # * \"False (uses only left-hand fingers)\"\n", 58 | "\n", 59 | "both = bool(right and left) # * \"True (uses both hand fingers)\"\n", 60 | "\n", 61 | "if both == True: \n", 62 | " print(\"True (uses both hand fingers)\")\n", 63 | " \n", 64 | "elif right == True:\n", 65 | " print(\"False(uses only right-hand fingers)\")\n", 66 | " \n", 67 | "else:\n", 68 | " print(\"False (uses only left-hand fingers)\")" 69 | ] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.8.8" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Covid19_Boolean.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "aa18f9b7", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Lutfen yasinizi giriniz : 45\n", 14 | "Kronik rahatsizliginiz varsa 1 e yoksa 0 sifira basiniz: 1\n", 15 | "Bagisiklik sisteminiz zayifsa 1 e guclu ise 0 sifira basiniz: 1\n", 16 | "There is a RISK of death\n" 17 | ] 18 | } 19 | ], 20 | "source": [ 21 | "x = int(input(\"Lutfen yasinizi giriniz : \"))\n", 22 | "age = (x >= 75) and True\n", 23 | "y = int(input(\"Kronik rahatsizliginiz varsa 1 e yoksa 0 sifira basiniz: \")) \n", 24 | "chronic = (y != 0) and True # can be assigned only True/False\n", 25 | "z = int(input(\"Bagisiklik sisteminiz zayifsa 1 e guclu ise 0 sifira basiniz: \"))\n", 26 | "immune = (z != 0) and True # can be assigned only True/False\n", 27 | "risk = age or chronic or immune \n", 28 | "print(risk == True and \"There is a RISK of death\" or \"There is NOT a RISK of death\")" 29 | ] 30 | } 31 | ], 32 | "metadata": { 33 | "kernelspec": { 34 | "display_name": "Python 3", 35 | "language": "python", 36 | "name": "python3" 37 | }, 38 | "language_info": { 39 | "codemirror_mode": { 40 | "name": "ipython", 41 | "version": 3 42 | }, 43 | "file_extension": ".py", 44 | "mimetype": "text/x-python", 45 | "name": "python", 46 | "nbconvert_exporter": "python", 47 | "pygments_lexer": "ipython3", 48 | "version": "3.8.8" 49 | } 50 | }, 51 | "nbformat": 4, 52 | "nbformat_minor": 5 53 | } 54 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Covid19_Risk.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "90e43468", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Are you a cigarette addict older than 75 years old? yes or no: yes\n", 14 | "Do you have a severe chronic disease? yes or no: no\n", 15 | "Is your immune system too weak? yes or no: yes\n", 16 | "You are in risky group\n" 17 | ] 18 | } 19 | ], 20 | "source": [ 21 | "age = str(input(\"Are you a cigarette addict older than 75 years old? yes or no: \")).title().strip() == \"Yes\"\n", 22 | "\n", 23 | "chronic = str(input(\"Do you have a severe chronic disease? yes or no: \")).title().strip() == \"Yes\"\n", 24 | "\n", 25 | "immune = str(input(\"Is your immune system too weak? yes or no: \")).title().strip() == \"Yes\"\n", 26 | "\n", 27 | "if (age or chronic or immune):\n", 28 | " print(\"You are in risky group\")\n", 29 | "else:\n", 30 | " print(\"You are not in risky group\")" 31 | ] 32 | } 33 | ], 34 | "metadata": { 35 | "kernelspec": { 36 | "display_name": "Python 3", 37 | "language": "python", 38 | "name": "python3" 39 | }, 40 | "language_info": { 41 | "codemirror_mode": { 42 | "name": "ipython", 43 | "version": 3 44 | }, 45 | "file_extension": ".py", 46 | "mimetype": "text/x-python", 47 | "name": "python", 48 | "nbconvert_exporter": "python", 49 | "pygments_lexer": "ipython3", 50 | "version": "3.8.8" 51 | } 52 | }, 53 | "nbformat": 4, 54 | "nbformat_minor": 5 55 | } 56 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Fibonacci_Numbers.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 13, 6 | "id": "070b0170", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "fibonacci sayıları : [1, 2, 3, 5, 8, 13, 21, 34, 55]\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "x, y, z = 0, 1, 2\n", 19 | "fibonacci=[]\n", 20 | "while z < 55:\n", 21 | " z = x + y\n", 22 | " x = y\n", 23 | " y = z\n", 24 | " fibonacci.append(z)\n", 25 | "print(\"fibonacci sayıları :\", fibonacci)" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 3, 31 | "id": "c09a7201", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "data": { 36 | "text/plain": [ 37 | "[1, 2, 3, 5, 8, 13, 21, 34, 55]" 38 | ] 39 | }, 40 | "execution_count": 3, 41 | "metadata": {}, 42 | "output_type": "execute_result" 43 | } 44 | ], 45 | "source": [ 46 | "def fib(n): \n", 47 | " result = []\n", 48 | " a, b = 1, 2\n", 49 | " while a < n+1:\n", 50 | " result.append(a)\n", 51 | " a, b = b, a+b\n", 52 | " return result\n", 53 | " \n", 54 | "fib(55)" 55 | ] 56 | } 57 | ], 58 | "metadata": { 59 | "kernelspec": { 60 | "display_name": "Python 3", 61 | "language": "python", 62 | "name": "python3" 63 | }, 64 | "language_info": { 65 | "codemirror_mode": { 66 | "name": "ipython", 67 | "version": 3 68 | }, 69 | "file_extension": ".py", 70 | "mimetype": "text/x-python", 71 | "name": "python", 72 | "nbconvert_exporter": "python", 73 | "pygments_lexer": "ipython3", 74 | "version": "3.8.8" 75 | } 76 | }, 77 | "nbformat": 4, 78 | "nbformat_minor": 5 79 | } 80 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Find Minimum_and_Sum_Numbers.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 3, 6 | "id": "d4d010e3", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "5\n", 14 | "-9\n", 15 | "-100\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "def my_min(*nums):\n", 21 | " return min(list(nums))\n", 22 | "\n", 23 | "print(my_min(5,6,7))\n", 24 | "print(my_min(3,8,-9,0,12,1.2))\n", 25 | "print(my_min(-100))" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 4, 31 | "id": "bf6c9871", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "name": "stdout", 36 | "output_type": "stream", 37 | "text": [ 38 | "12\n", 39 | "16\n", 40 | "60\n" 41 | ] 42 | } 43 | ], 44 | "source": [ 45 | "def my_sum(*nums):\n", 46 | " return sum(list(nums))\n", 47 | "\n", 48 | "print(my_sum(9, 1, 3, 0, -1))\n", 49 | "print(my_sum(5, 7, 4))\n", 50 | "print(my_sum(10, -20, 30, 40))" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "id": "1a222201", 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "id": "8df8a713", 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "id": "bca73647", 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [] 76 | } 77 | ], 78 | "metadata": { 79 | "kernelspec": { 80 | "display_name": "Python 3", 81 | "language": "python", 82 | "name": "python3" 83 | }, 84 | "language_info": { 85 | "codemirror_mode": { 86 | "name": "ipython", 87 | "version": 3 88 | }, 89 | "file_extension": ".py", 90 | "mimetype": "text/x-python", 91 | "name": "python", 92 | "nbconvert_exporter": "python", 93 | "pygments_lexer": "ipython3", 94 | "version": "3.8.8" 95 | } 96 | }, 97 | "nbformat": 4, 98 | "nbformat_minor": 5 99 | } 100 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Letters_Count.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "514c047c", 6 | "metadata": {}, 7 | "source": [ 8 | "Write your Python codes on any IDE and push it up to your GitHub repository, \n", 9 | "then submit your GitHub page address link in addition to your codes (answer) as a plain text. \n", 10 | "Task:\n", 11 | "\n", 12 | "Count the number of each letter in a sentence.\n", 13 | "The department you work for undertook a project construction \n", 14 | "that makes word / text analysis. You are asked to calculate the \n", 15 | "number of letters or any chars in the sentences entered under this project.\n", 16 | "Write a Python program that;\n", 17 | "takes a sentence from the user,\n", 18 | "counts the number of each letter of the sentence,\n", 19 | "collects the letters/chars as a key and the counted numbers as a value in a dictionary.\n", 20 | "\n", 21 | "Examples\n", 22 | "Sample inputs\tOutputs\n", 23 | "hippo runs to us!\t\n", 24 | "{'s': 2, 'r': 1, 't': 1, 'h': 1, 'n': 1, \n", 25 | "'i': 1, 'u': 2, 'o': 2, 'p': 2, ' ': 3, '!': 1}\n", 26 | "\n", 27 | "\n", 28 | "Note that; this question is famous on the web, so that do it yourself \n", 29 | "to get more benefits from it. By the way, Do not use try - except block." 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": null, 35 | "id": "d41cc12c", 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "hippo runs to us!\n", 40 | "{'s': 2, 'r': 1, 't': 1, 'h': 1, 'n': 1, \n", 41 | "'i': 1, 'u': 2, 'o': 2, 'p': 2, ' ': 3, '!': 1}" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 4, 47 | "id": "f89cb998", 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "name": "stdout", 52 | "output_type": "stream", 53 | "text": [ 54 | "Enter your sentence: hippo runs to us!\n", 55 | "{'h': 1, 'i': 1, 'p': 2, 'o': 2, ' ': 3, 'r': 1, 'u': 2, 'n': 1, 's': 2, 't': 1, '!': 1}\n" 56 | ] 57 | } 58 | ], 59 | "source": [ 60 | "text = input(\"Enter your sentence: \").lower()\n", 61 | "counts = {}\n", 62 | "for i in text:\n", 63 | " if i not in counts:\n", 64 | " counts[i] = 1\n", 65 | " else:\n", 66 | " counts[i] += 1\n", 67 | "print(counts)" 68 | ] 69 | } 70 | ], 71 | "metadata": { 72 | "kernelspec": { 73 | "display_name": "Python 3", 74 | "language": "python", 75 | "name": "python3" 76 | }, 77 | "language_info": { 78 | "codemirror_mode": { 79 | "name": "ipython", 80 | "version": 3 81 | }, 82 | "file_extension": ".py", 83 | "mimetype": "text/x-python", 84 | "name": "python", 85 | "nbconvert_exporter": "python", 86 | "pygments_lexer": "ipython3", 87 | "version": "3.8.8" 88 | } 89 | }, 90 | "nbformat": 4, 91 | "nbformat_minor": 5 92 | } 93 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Measure_Converter.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 3, 6 | "id": "e20624ab", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Lutfen derece bilgisini giriniz :145\n", 14 | "145.0 C'nin fahrenayta donusmus hali 293.0 F'tir.\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "derece = float(input(\"Lutfen derece bilgisini giriniz :\"))\n", 20 | "fahrenayt = 1.8 * float(derece) + 32 \n", 21 | "print(derece, \"C'nin fahrenayta donusmus hali\", fahrenayt, \"F'tir.\")" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 2, 27 | "id": "dead44ed", 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "name": "stdout", 32 | "output_type": "stream", 33 | "text": [ 34 | "Lutfen kilometre bilgisini giriniz :75\n", 35 | "75.0 kilometre 46.602825 mil eder.\n" 36 | ] 37 | } 38 | ], 39 | "source": [ 40 | "km = float(input(\"Lutfen kilometre bilgisini giriniz :\"))\n", 41 | "kmil_oran = 0.621371\n", 42 | "mil = (km * kmil_oran)\n", 43 | "print(str(km), \"kilometre\", str(mil), \"mil eder.\")" 44 | ] 45 | } 46 | ], 47 | "metadata": { 48 | "kernelspec": { 49 | "display_name": "Python 3", 50 | "language": "python", 51 | "name": "python3" 52 | }, 53 | "language_info": { 54 | "codemirror_mode": { 55 | "name": "ipython", 56 | "version": 3 57 | }, 58 | "file_extension": ".py", 59 | "mimetype": "text/x-python", 60 | "name": "python", 61 | "nbconvert_exporter": "python", 62 | "pygments_lexer": "ipython3", 63 | "version": "3.8.8" 64 | } 65 | }, 66 | "nbformat": 4, 67 | "nbformat_minor": 5 68 | } 69 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Negative_Meaning.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "04171d7e", 6 | "metadata": {}, 7 | "source": [ 8 | "Define a function to take a word and return negative meaning.\n", 9 | "Given a word, return a new word where \"not \" \n", 10 | "has been added to the front. However, if the word \n", 11 | "already begins with \"not\", return the string unchanged.\n", 12 | "\n", 13 | "For example:\n", 14 | "\n", 15 | "Test\tResult\n", 16 | "print(not_string('sugar'))\n", 17 | "not sugar\n", 18 | "print(not_string('x'))\n", 19 | "not x\n", 20 | "print(not_string('not bad'))\n", 21 | "not bad" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 26, 27 | "id": "7c8aa7ce", 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "name": "stdout", 32 | "output_type": "stream", 33 | "text": [ 34 | "not sugar\n", 35 | "not free\n", 36 | "not x\n", 37 | "not bad\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "def not_string(word):\n", 43 | " if \"not\" in word:\n", 44 | " return word\n", 45 | " else:\n", 46 | " word = \"not \" + word\n", 47 | " return word \n", 48 | "\n", 49 | "\n", 50 | "print(not_string(\"sugar\"))\n", 51 | "print(not_string('free'))\n", 52 | "print(not_string('x'))\n", 53 | "print(not_string('not bad')) " 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 27, 59 | "id": "77aae755", 60 | "metadata": {}, 61 | "outputs": [ 62 | { 63 | "name": "stdout", 64 | "output_type": "stream", 65 | "text": [ 66 | "not sugar\n", 67 | "not free\n", 68 | "not x\n", 69 | "not bad\n" 70 | ] 71 | } 72 | ], 73 | "source": [ 74 | "def not_string(word):\n", 75 | " if not \"not\" in word:\n", 76 | " return \"not \" + word\n", 77 | " else:\n", 78 | " return word\n", 79 | "\n", 80 | "\n", 81 | "print(not_string(\"sugar\"))\n", 82 | "print(not_string('free'))\n", 83 | "print(not_string('x'))\n", 84 | "print(not_string('not bad')) " 85 | ] 86 | } 87 | ], 88 | "metadata": { 89 | "kernelspec": { 90 | "display_name": "Python 3", 91 | "language": "python", 92 | "name": "python3" 93 | }, 94 | "language_info": { 95 | "codemirror_mode": { 96 | "name": "ipython", 97 | "version": 3 98 | }, 99 | "file_extension": ".py", 100 | "mimetype": "text/x-python", 101 | "name": "python", 102 | "nbconvert_exporter": "python", 103 | "pygments_lexer": "ipython3", 104 | "version": "3.8.8" 105 | } 106 | }, 107 | "nbformat": 4, 108 | "nbformat_minor": 5 109 | } 110 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Password_Reminder.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 8, 6 | "id": "d242564d", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Please enter your name:halit\n", 14 | "Hello, Halit! The password is : hy12@345\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "name = input(\"Please enter your name:\").title().strip()\n", 20 | "user_name = \"Halit\"\n", 21 | "user_password = \"hy12@345\" \n", 22 | "\n", 23 | "if name == user_name:\n", 24 | " print(f\"Hello, {user_name}! The password is : {user_password}\")\n", 25 | " \n", 26 | "else:\n", 27 | " print(f\"Hello, {name}! See you later.\")" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 9, 33 | "id": "c6fc4806", 34 | "metadata": {}, 35 | "outputs": [ 36 | { 37 | "name": "stdout", 38 | "output_type": "stream", 39 | "text": [ 40 | "Please enter your name:joseph\n" 41 | ] 42 | }, 43 | { 44 | "data": { 45 | "text/plain": [ 46 | "'Hello, Joseph! The password is : W@12'" 47 | ] 48 | }, 49 | "execution_count": 9, 50 | "metadata": {}, 51 | "output_type": "execute_result" 52 | } 53 | ], 54 | "source": [ 55 | "name = str(input(\"Please enter your name:\")).title().strip()\n", 56 | "\n", 57 | "a = bool(name == \"Joseph\") * (f\"Hello, {name}! The password is : W@12\")\n", 58 | "b = bool(name != \"Joseph\") * (f\"Hello, {name}! See you later.\")\n", 59 | "a or b" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": null, 65 | "id": "ab189ab3", 66 | "metadata": {}, 67 | "outputs": [], 68 | "source": [] 69 | } 70 | ], 71 | "metadata": { 72 | "kernelspec": { 73 | "display_name": "Python 3", 74 | "language": "python", 75 | "name": "python3" 76 | }, 77 | "language_info": { 78 | "codemirror_mode": { 79 | "name": "ipython", 80 | "version": 3 81 | }, 82 | "file_extension": ".py", 83 | "mimetype": "text/x-python", 84 | "name": "python", 85 | "nbconvert_exporter": "python", 86 | "pygments_lexer": "ipython3", 87 | "version": "3.8.8" 88 | } 89 | }, 90 | "nbformat": 4, 91 | "nbformat_minor": 5 92 | } 93 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Prime_Number.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 64, 6 | "id": "7648d309", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter a number: 1973\n", 14 | "1973 is a prime number\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "number = int(input(\"Enter a number: \"))\n", 20 | "if all (number % i != 0 for i in range(2, number)):\n", 21 | " print(number,\"is a prime number\") \n", 22 | "else:\n", 23 | " print(number,\"is not a prime number\") " 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 2, 29 | "id": "e0a01146", 30 | "metadata": {}, 31 | "outputs": [ 32 | { 33 | "name": "stdout", 34 | "output_type": "stream", 35 | "text": [ 36 | "Enter a number to check if it is a prime number.12\n", 37 | "12 is not a prime number.\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "n = int(input(\"Enter a number to check if it is a prime number.\"))\n", 43 | "count = 0\n", 44 | "for i in range(1, n+1) :\n", 45 | " if n % i == 0 :\n", 46 | " count += 1\n", 47 | "if (n == 0) or (n == 1) or (count >=3) :\n", 48 | " print(n, \"is not a prime number.\")\n", 49 | "else:\n", 50 | " print(n, \"is a prime number\")" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "id": "461d3aa3", 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "id": "26a6171f", 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [] 68 | } 69 | ], 70 | "metadata": { 71 | "kernelspec": { 72 | "display_name": "Python 3", 73 | "language": "python", 74 | "name": "python3" 75 | }, 76 | "language_info": { 77 | "codemirror_mode": { 78 | "name": "ipython", 79 | "version": 3 80 | }, 81 | "file_extension": ".py", 82 | "mimetype": "text/x-python", 83 | "name": "python", 84 | "nbconvert_exporter": "python", 85 | "pygments_lexer": "ipython3", 86 | "version": "3.8.8" 87 | } 88 | }, 89 | "nbformat": 4, 90 | "nbformat_minor": 5 91 | } 92 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Prime_Numbers2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "c0a54cd8", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Sayi Giriniz:100\n", 14 | "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "sayi = int(input(\"Sayi Giriniz:\"))\n", 20 | "lst=[] \n", 21 | "for i in range(2,(sayi)):\n", 22 | " sayac=0\n", 23 | " for j in range(2,i):\n", 24 | " if(i%j==0):\n", 25 | " sayac=sayac+1\n", 26 | " if(sayac==0):\n", 27 | " lst.append(i) \n", 28 | "print(lst)" 29 | ] 30 | } 31 | ], 32 | "metadata": { 33 | "kernelspec": { 34 | "display_name": "Python 3", 35 | "language": "python", 36 | "name": "python3" 37 | }, 38 | "language_info": { 39 | "codemirror_mode": { 40 | "name": "ipython", 41 | "version": 3 42 | }, 43 | "file_extension": ".py", 44 | "mimetype": "text/x-python", 45 | "name": "python", 46 | "nbconvert_exporter": "python", 47 | "pygments_lexer": "ipython3", 48 | "version": "3.8.8" 49 | } 50 | }, 51 | "nbformat": 4, 52 | "nbformat_minor": 5 53 | } 54 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Profit_Calculator.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "266acde2", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "1605.7814764784307\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "kripto_para = 1000\n", 19 | "oran = 7\n", 20 | "yuzde_oran = oran / 100 \n", 21 | "vade = 7\n", 22 | "toplam = kripto_para * (1 + yuzde_oran) ** vade \n", 23 | "print(toplam)\n" 24 | ] 25 | } 26 | ], 27 | "metadata": { 28 | "kernelspec": { 29 | "display_name": "Python 3", 30 | "language": "python", 31 | "name": "python3" 32 | }, 33 | "language_info": { 34 | "codemirror_mode": { 35 | "name": "ipython", 36 | "version": 3 37 | }, 38 | "file_extension": ".py", 39 | "mimetype": "text/x-python", 40 | "name": "python", 41 | "nbconvert_exporter": "python", 42 | "pygments_lexer": "ipython3", 43 | "version": "3.8.8" 44 | } 45 | }, 46 | "nbformat": 4, 47 | "nbformat_minor": 5 48 | } 49 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_The_Most_Frequent_Element.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "9031fe7a", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "En cok tekrar eden sayi 3. Tekrar sayisi ise 4'dir.\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "numbers = [1, 3, 7, 4, 3, 0, 3, 6, 3]\n", 19 | "\n", 20 | "max_tekrar = 0\n", 21 | "\n", 22 | "for i in numbers:\n", 23 | "\n", 24 | " tekrar_sayisi = numbers.count(i)\n", 25 | "\n", 26 | " if(tekrar_sayisi > max_tekrar):\n", 27 | "\n", 28 | " max_tekrar = i\n", 29 | "\n", 30 | "print(f\"En cok tekrar eden sayi {max_tekrar}. Tekrar sayisi ise {tekrar_sayisi}'dir.\")" 31 | ] 32 | } 33 | ], 34 | "metadata": { 35 | "kernelspec": { 36 | "display_name": "Python 3", 37 | "language": "python", 38 | "name": "python3" 39 | }, 40 | "language_info": { 41 | "codemirror_mode": { 42 | "name": "ipython", 43 | "version": 3 44 | }, 45 | "file_extension": ".py", 46 | "mimetype": "text/x-python", 47 | "name": "python", 48 | "nbconvert_exporter": "python", 49 | "pygments_lexer": "ipython3", 50 | "version": "3.8.8" 51 | } 52 | }, 53 | "nbformat": 4, 54 | "nbformat_minor": 5 55 | } 56 | -------------------------------------------------------------------------------- /Python-Assignments/Assignment_Your_Factorial.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "6b53603f", 6 | "metadata": {}, 7 | "source": [ 8 | "Define a function named my_fact to calculate factorial of the given number. \n", 9 | "Given a non-negative integer return the factorial of the integer.\n", 10 | "\n", 11 | "(Example: The factorial of 5 is: 5*4*3*2*1 = 120 and factorial of 0 is: 1)" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 3, 17 | "id": "e4260bf4", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "6\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "def my_fact(num):\n", 30 | " fak = 1\n", 31 | " for i in range(1,num+1):\n", 32 | " fak *=i\n", 33 | " return fak\n", 34 | "print(my_fact(3))" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 4, 40 | "id": "98e60ec6", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "name": "stdout", 45 | "output_type": "stream", 46 | "text": [ 47 | "6\n" 48 | ] 49 | } 50 | ], 51 | "source": [ 52 | "def my_fact(n):\n", 53 | " fak = 1\n", 54 | " for i in range(1,n+1):\n", 55 | " fak *=i\n", 56 | " return fak\n", 57 | "print(my_fact(3))" 58 | ] 59 | } 60 | ], 61 | "metadata": { 62 | "kernelspec": { 63 | "display_name": "Python 3", 64 | "language": "python", 65 | "name": "python3" 66 | }, 67 | "language_info": { 68 | "codemirror_mode": { 69 | "name": "ipython", 70 | "version": 3 71 | }, 72 | "file_extension": ".py", 73 | "mimetype": "text/x-python", 74 | "name": "python", 75 | "nbconvert_exporter": "python", 76 | "pygments_lexer": "ipython3", 77 | "version": "3.8.8" 78 | } 79 | }, 80 | "nbformat": 4, 81 | "nbformat_minor": 5 82 | } 83 | -------------------------------------------------------------------------------- /Python-Assignments/README.md: -------------------------------------------------------------------------------- 1 | # python_assignments 2 | Bu repo python dersindeki assignmentlerden olusmaktadir. 3 | -------------------------------------------------------------------------------- /Python-Derspaylasim/.ipynb_checkpoints/Facebook_Likes_Challenge-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Derspaylasim/.ipynb_checkpoints/Module_creating and calling Mehmet-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "a79c82e3", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "data": { 11 | "text/plain": [ 12 | "'C:\\\\Users\\\\Pc\\\\Documents\\\\Pythoncular\\\\Python-Derspaylasim'" 13 | ] 14 | }, 15 | "execution_count": 1, 16 | "metadata": {}, 17 | "output_type": "execute_result" 18 | } 19 | ], 20 | "source": [ 21 | "pwd" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 4, 27 | "id": "429eda82", 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "ename": "ModuleNotFoundError", 32 | "evalue": "No module named 'upper_package'", 33 | "output_type": "error", 34 | "traceback": [ 35 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 36 | "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", 37 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mupper_package\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmy_package1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmy_package2\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mupper_package\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmy_package1\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmy_module_1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmy_module_2\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", 38 | "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'upper_package'" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "from upper_package import my_package1, my_package2\n", 44 | "from upper_package.my_package1 import my_module_1, my_module_2" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "8e7e7e5d", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "5458a99d", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | } 63 | ], 64 | "metadata": { 65 | "kernelspec": { 66 | "display_name": "Python 3", 67 | "language": "python", 68 | "name": "python3" 69 | }, 70 | "language_info": { 71 | "codemirror_mode": { 72 | "name": "ipython", 73 | "version": 3 74 | }, 75 | "file_extension": ".py", 76 | "mimetype": "text/x-python", 77 | "name": "python", 78 | "nbconvert_exporter": "python", 79 | "pygments_lexer": "ipython3", 80 | "version": "3.8.8" 81 | } 82 | }, 83 | "nbformat": 4, 84 | "nbformat_minor": 5 85 | } 86 | -------------------------------------------------------------------------------- /Python-Derspaylasim/.ipynb_checkpoints/ZIP_METOT-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Derspaylasim/31_PythonReview.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stdout", 10 | "output_type": "stream", 11 | "text": [ 12 | "apple\n", 13 | "cherry\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "fruits = [\"apple\", \"banana\", \"cherry\"]\n", 19 | "for x in fruits:\n", 20 | " if x == \"banana\":\n", 21 | " continue\n", 22 | " print(x)" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 2, 28 | "metadata": {}, 29 | "outputs": [ 30 | { 31 | "name": "stdout", 32 | "output_type": "stream", 33 | "text": [ 34 | "0\n", 35 | "1\n", 36 | "2\n", 37 | "3\n", 38 | "4\n", 39 | "5\n" 40 | ] 41 | } 42 | ], 43 | "source": [ 44 | "for x in range(6):\n", 45 | " print(x)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "def my_decorator(func):\n", 55 | " def wrapper():\n", 56 | " # Do something before\n", 57 | " result = func() # or only func()\n", 58 | " # Do something after\n", 59 | " return result # or erase this line, with only func() above\n", 60 | " return wrapper\n", 61 | "\n", 62 | "@my_decorator\n", 63 | "def func():\n", 64 | " pass" 65 | ] 66 | } 67 | ], 68 | "metadata": { 69 | "interpreter": { 70 | "hash": "40d3a090f54c6569ab1632332b64b2c03c39dcf918b08424e98f38b5ae0af88f" 71 | }, 72 | "kernelspec": { 73 | "display_name": "Python 3.8.8 64-bit ('base': conda)", 74 | "language": "python", 75 | "name": "python3" 76 | }, 77 | "language_info": { 78 | "codemirror_mode": { 79 | "name": "ipython", 80 | "version": 3 81 | }, 82 | "file_extension": ".py", 83 | "mimetype": "text/x-python", 84 | "name": "python", 85 | "nbconvert_exporter": "python", 86 | "pygments_lexer": "ipython3", 87 | "version": "3.8.8" 88 | }, 89 | "orig_nbformat": 4 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 2 93 | } 94 | -------------------------------------------------------------------------------- /Python-Derspaylasim/oop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/oop.py -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/__init__.py -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/paket1/__init__.py -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket1/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/paket1/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket1/__pycache__/module1.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/paket1/__pycache__/module1.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket1/module1.py: -------------------------------------------------------------------------------- 1 | ''' 2 | This is module 1. Welcome! 3 | ''' 4 | def addition(a,b): 5 | return a + b 6 | def multi(x,y): 7 | return x * y -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/paket2/__init__.py -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket2/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/paket2/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket2/__pycache__/module2.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Derspaylasim/paketler/paket2/__pycache__/module2.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Derspaylasim/paketler/paket2/module2.py: -------------------------------------------------------------------------------- 1 | ''' 2 | This is module 2. Welcome! 3 | ''' 4 | def divide(a,b): 5 | return (a / b) 6 | def hello(): 7 | print("hello") -------------------------------------------------------------------------------- /Python-Documents/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/.DS_Store -------------------------------------------------------------------------------- /Python-Documents/.ipynb_checkpoints/Circle_Area_import-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Documents/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Documents/Circle_Area_import.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "fa32aa84", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "from upper_package.my_package_1 import circle" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 11, 16 | "id": "dc108561", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "data": { 21 | "text/plain": [ 22 | "78.5" 23 | ] 24 | }, 25 | "execution_count": 11, 26 | "metadata": {}, 27 | "output_type": "execute_result" 28 | } 29 | ], 30 | "source": [ 31 | "circle.circlearea(5)" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 10, 37 | "id": "c7936fba", 38 | "metadata": {}, 39 | "outputs": [ 40 | { 41 | "data": { 42 | "text/plain": [ 43 | "31.400000000000002" 44 | ] 45 | }, 46 | "execution_count": 10, 47 | "metadata": {}, 48 | "output_type": "execute_result" 49 | } 50 | ], 51 | "source": [ 52 | "circle.aroundcircle(5)" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "51f20fec", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "d68f9cf6", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.8.8" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /Python-Documents/Untitled.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Documents/benim_ilk_dosyam.txt: -------------------------------------------------------------------------------- 1 | 1- my first sentence 2 | 2- my second sentence 3 | 3- my third sentence 4 | 4- my fourth sentence 5 | 5- my fifth sentence 6 | -------------------------------------------------------------------------------- /Python-Documents/circle.py: -------------------------------------------------------------------------------- 1 | """ 2 | This modul calculate area of the circle and around of the circle. 3 | 4 | 5 | """ 6 | 7 | 8 | 9 | pi = 3.14 10 | 11 | 12 | def circlearea(r): 13 | area = pi * r **2 #r = radius 14 | return area 15 | 16 | def aroundcircle(r): 17 | around = 2 * pi * r #r = radius 18 | return around -------------------------------------------------------------------------------- /Python-Documents/fishes.txt: -------------------------------------------------------------------------------- 1 | Orca is a kind of Dolphin. 2 | Blue Whale is the largest animal known on earth. 3 | Sharks are the sister group to the Rays (batoids). 4 | The Tuna Fish can weigh up to 260 kg. 5 | Squid and Octopus are in the same class. -------------------------------------------------------------------------------- /Python-Documents/fruits.csv: -------------------------------------------------------------------------------- 1 | no,fruit,amount 2 | 1,Banana,4 lb 3 | 2,Orange,5 lb 4 | 3,Apple,2 lb 5 | 4,Strawberry,6 lb 6 | 5,Cherry,3 lb -------------------------------------------------------------------------------- /Python-Documents/fruits.txt: -------------------------------------------------------------------------------- 1 | Banana 2 | Orange 3 | Apple 4 | Strawberry 5 | Cherry 6 | -------------------------------------------------------------------------------- /Python-Documents/fruits2.txt: -------------------------------------------------------------------------------- 1 | Banana 2 | Orange 3 | Apple 4 | Strawberry 5 | Cherry 6 | -------------------------------------------------------------------------------- /Python-Documents/fruits3.txt: -------------------------------------------------------------------------------- 1 | Banana 2 | Orange 3 | Apple 4 | Strawberry 5 | Cherry 6 | -------------------------------------------------------------------------------- /Python-Documents/rumi.txt: -------------------------------------------------------------------------------- 1 | I want to sign 2 | Like a birds sing, 3 | Not worry about 4 | Who ears or 5 | That they think. -------------------------------------------------------------------------------- /Python-Documents/upper_package/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/__init__.py -------------------------------------------------------------------------------- /Python-Documents/upper_package/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_1/__init__.py -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_1/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/__pycache__/circle.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_1/__pycache__/circle.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/__pycache__/my_module_1.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_1/__pycache__/my_module_1.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/__pycache__/my_module_2.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_1/__pycache__/my_module_2.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/circle.py: -------------------------------------------------------------------------------- 1 | """ 2 | This modul calculate area of the circle and around of the circle. 3 | 4 | 5 | """ 6 | 7 | 8 | 9 | pi = 3.14 10 | 11 | 12 | def circlearea(r): 13 | area = pi * r **2 #r = radius 14 | return area 15 | 16 | def aroundcircle(r): 17 | around = 2 * pi * r #r = radius 18 | return around -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/my_module_1.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is module 1. Welcome! 3 | """ 4 | 5 | def addition(a, b): 6 | return a + b 7 | 8 | def multi(x, y): 9 | return x * y -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_1/my_module_2.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is module 2. Welcome! 3 | """ 4 | 5 | def divide(a, b): 6 | return (a/b) 7 | 8 | def hello(): 9 | print("hello") -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_2/__init__.py -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_2/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_2/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_2/__pycache__/my_module_3.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_2/__pycache__/my_module_3.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_2/__pycache__/my_module_4.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Halityildiz/Pythoncular/3a2023b51d985b96124bc1891bdd0b581d779691/Python-Documents/upper_package/my_package_2/__pycache__/my_module_4.cpython-38.pyc -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_2/my_module_3.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is module 3. Welcome! 3 | """ 4 | 5 | def concat_str(a, b): 6 | return a + b 7 | 8 | def repeater(x, y): 9 | return x * y -------------------------------------------------------------------------------- /Python-Documents/upper_package/my_package_2/my_module_4.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is module 4. Welcome! 3 | """ 4 | 5 | def square(a): 6 | return (a ** 2) 7 | 8 | def sqroot(b): 9 | return b ** 0.5 10 | 11 | -------------------------------------------------------------------------------- /Python-Workshops/.ipynb_checkpoints/Code_Challenge(Missing_chart, Front_back)-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 32, 6 | "id": "578a5f3f", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "ktchen\n", 14 | "kitcen\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "def missing_char(word, n):\n", 20 | " return word.replace(word[n], \"\") \n", 21 | " \n", 22 | "print(missing_char('kitchen', 1))\n", 23 | "print(missing_char('kitchen', 4))" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 85, 29 | "id": "705fa089", 30 | "metadata": {}, 31 | "outputs": [ 32 | { 33 | "name": "stdout", 34 | "output_type": "stream", 35 | "text": [ 36 | "ylaruswac\n" 37 | ] 38 | } 39 | ], 40 | "source": [ 41 | "def front_back(word):\n", 42 | " new = \"\"\n", 43 | " for i in word:\n", 44 | " if i == word[0]:\n", 45 | " new += word[-1]\n", 46 | " elif i == word[-1]:\n", 47 | " new += word[0]\n", 48 | " else:\n", 49 | " new += i\n", 50 | " return new\n", 51 | " \n", 52 | "print(front_back('clarusway'))" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "8bd7d1f3", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "f0c3e5e4", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.8.8" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /Python-Workshops/.ipynb_checkpoints/Number_Place_Value 09.08-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "87c07712", 6 | "metadata": {}, 7 | "source": [ 8 | "Create a function that takes a number num and returns each place value in the number. Examples num_split(39) ➞ [30, 9]\n", 9 | "\n", 10 | "num_split(-434) ➞ [-400, -30, -4]\n", 11 | "\n", 12 | "num_split(100) ➞ [100, 0, 0]" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 3, 18 | "id": "dc1c4509", 19 | "metadata": {}, 20 | "outputs": [ 21 | { 22 | "data": { 23 | "text/plain": [ 24 | "[300, 60, 8]" 25 | ] 26 | }, 27 | "execution_count": 3, 28 | "metadata": {}, 29 | "output_type": "execute_result" 30 | } 31 | ], 32 | "source": [ 33 | "num = 368\n", 34 | "lst = []\n", 35 | "a = 1\n", 36 | "\n", 37 | "if num < 0:\n", 38 | " a = -1\n", 39 | " \n", 40 | "for i in str(abs(num))[::-1]:\n", 41 | " b = int(i) * a\n", 42 | " a = a * 10\n", 43 | " lst.append(b) \n", 44 | "lst.reverse()\n", 45 | "lst" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 1, 51 | "id": "53b4769e", 52 | "metadata": {}, 53 | "outputs": [ 54 | { 55 | "data": { 56 | "text/plain": [ 57 | "[-100, -40, -5]" 58 | ] 59 | }, 60 | "execution_count": 1, 61 | "metadata": {}, 62 | "output_type": "execute_result" 63 | } 64 | ], 65 | "source": [ 66 | "def num_split(num):\n", 67 | " lst = []\n", 68 | " a = 1\n", 69 | " if num < 0:\n", 70 | " a = -1\n", 71 | " \n", 72 | " for i in str(abs(num))[::-1]:\n", 73 | " b = int(i) * a\n", 74 | " a *= 10\n", 75 | " lst.append(b)\n", 76 | " lst.reverse()\n", 77 | " return lst\n", 78 | "num_split(-145)" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "id": "a113aa3c", 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "id": "b6b92de9", 93 | "metadata": {}, 94 | "outputs": [], 95 | "source": [] 96 | } 97 | ], 98 | "metadata": { 99 | "kernelspec": { 100 | "display_name": "Python 3", 101 | "language": "python", 102 | "name": "python3" 103 | }, 104 | "language_info": { 105 | "codemirror_mode": { 106 | "name": "ipython", 107 | "version": 3 108 | }, 109 | "file_extension": ".py", 110 | "mimetype": "text/x-python", 111 | "name": "python", 112 | "nbconvert_exporter": "python", 113 | "pygments_lexer": "ipython3", 114 | "version": "3.8.8" 115 | } 116 | }, 117 | "nbformat": 4, 118 | "nbformat_minor": 5 119 | } 120 | -------------------------------------------------------------------------------- /Python-Workshops/.ipynb_checkpoints/Prime_Number_Factors 09.08-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "03960c0d", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "Create a function that returns a list containing the \n", 11 | "prime factors of whatever integer is passed to it. \n", 12 | "Examples prime_factors(20) ➞ [2, 2, 5] \n", 13 | "prime_factors(100) ➞ [2, 2, 5, 5] \n", 14 | "prime_factors(8912234) ➞ [2, 47, 94811]" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "id": "c88e4fc0", 21 | "metadata": {}, 22 | "outputs": [ 23 | { 24 | "data": { 25 | "text/plain": [ 26 | "[2, 2, 5, 5]" 27 | ] 28 | }, 29 | "execution_count": 1, 30 | "metadata": {}, 31 | "output_type": "execute_result" 32 | } 33 | ], 34 | "source": [ 35 | "def prime_factors(num):\n", 36 | " lst = []\n", 37 | " while num != 1:\n", 38 | " for i in range(2, num + 1):\n", 39 | " if num % i == 0:\n", 40 | " num //= i\n", 41 | " lst.append(i)\n", 42 | " break\n", 43 | " return lst\n", 44 | "prime_factors(100)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "32968f39", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "248d7fe9", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "174e4ed8", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.8.8" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /Python-Workshops/.ipynb_checkpoints/teamwork_11-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Python-Workshops/Code_Challenge(Missing_chart, Front_back).ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 32, 6 | "id": "578a5f3f", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "ktchen\n", 14 | "kitcen\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "def missing_char(word, n):\n", 20 | " return word.replace(word[n], \"\") \n", 21 | " \n", 22 | "print(missing_char('kitchen', 1))\n", 23 | "print(missing_char('kitchen', 4))" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "id": "47af7da6", 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "def front_back(word):\n", 34 | " if len(word) == 1:\n", 35 | " word = word\n", 36 | " else:\n", 37 | " word = word[len(word)-1] + word[1:(len(word)-1)] + word[0]\n", 38 | " return word\n", 39 | "front_back(\"Kemal\")" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 85, 45 | "id": "705fa089", 46 | "metadata": {}, 47 | "outputs": [ 48 | { 49 | "name": "stdout", 50 | "output_type": "stream", 51 | "text": [ 52 | "ylaruswac\n" 53 | ] 54 | } 55 | ], 56 | "source": [ 57 | "def front_back(word):\n", 58 | " new = \"\"\n", 59 | " for i in word:\n", 60 | " if i == word[0]:\n", 61 | " new += word[-1]\n", 62 | " elif i == word[-1]:\n", 63 | " new += word[0]\n", 64 | " else:\n", 65 | " new += i\n", 66 | " return new\n", 67 | " \n", 68 | "print(front_back('clarusway'))" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": null, 74 | "id": "8bd7d1f3", 75 | "metadata": {}, 76 | "outputs": [], 77 | "source": [] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "id": "f0c3e5e4", 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [] 86 | } 87 | ], 88 | "metadata": { 89 | "kernelspec": { 90 | "display_name": "Python 3", 91 | "language": "python", 92 | "name": "python3" 93 | }, 94 | "language_info": { 95 | "codemirror_mode": { 96 | "name": "ipython", 97 | "version": 3 98 | }, 99 | "file_extension": ".py", 100 | "mimetype": "text/x-python", 101 | "name": "python", 102 | "nbconvert_exporter": "python", 103 | "pygments_lexer": "ipython3", 104 | "version": "3.8.8" 105 | } 106 | }, 107 | "nbformat": 4, 108 | "nbformat_minor": 5 109 | } 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pythoncular 2 | Phyton klasorlerini tek repoda birlestirmek icin kullanilmaktadir. 3 | --------------------------------------------------------------------------------