├── Sec.txt ├── FormHafta6_14022019.zip ├── TelafiDersi_Sec2_19032019.py ├── README.md ├── Nesne Tabanlı Programlama Projesi.pdf ├── FormHafta6_14022019 ├── FormHafta6_14022019 │ ├── obj │ │ └── Debug │ │ │ ├── FormHafta6_14022019.csproj.CoreCompileInputs.cache │ │ │ ├── FormHafta6_14022019.exe │ │ │ ├── FormHafta6_14022019.pdb │ │ │ ├── FormHafta6_14022019.Form1.resources │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ ├── FormHafta6_14022019.Properties.Resources.resources │ │ │ ├── FormHafta6_14022019.csproj.GenerateResource.cache │ │ │ ├── FormHafta6_14022019.csprojAssemblyReference.cache │ │ │ └── FormHafta6_14022019.csproj.FileListAbsolute.txt │ ├── bin │ │ └── Debug │ │ │ ├── FormHafta6_14022019.exe │ │ │ ├── FormHafta6_14022019.pdb │ │ │ └── FormHafta6_14022019.exe.config │ ├── App.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Program.cs │ ├── Form1.cs │ ├── FormHafta6_14022019.csproj │ ├── Form1.resx │ └── Form1.Designer.cs └── FormHafta6_14022019.sln ├── Python Proje Konu Başlık Önerileri.docx ├── Moduller_Sec2 ├── modulum.py └── dortislem.py ├── Moduller ├── dortislem.py ├── ilkmodulum.py ├── hesaplama.py └── sayitahmin.py ├── Tutorials.adoc ├── ErsinHocaOrnek.py ├── PythonProjeKonuBaslikOnerileri ├── 11.txt ├── ErsinHocaDersOrnegi.py ├── Hafta3_Sec2_21022019.py ├── Hafta8_Sec2_04042019.py ├── Hafta9_Sec1_11042019_2.py ├── Hafta9_Sec1_11042019.py ├── Hafta9_Sec2_11042019.py ├── Hafta7_Sec1_21032019.py ├── Hafta1_Sec2_07022019.py ├── Hafta13_Sec2_02052019.py ├── Hafta6_Sec2_14032019.py ├── Hafta9_Sec2_11042019_2.py ├── Hafta1_Sec1_07022019.py ├── Hafta8_Sec1_04042019.py ├── TelafiDersi_Sec1_15032019.py ├── Hafta4_Sec2_28022019.py ├── Hafta2_Sec1_14022019.py ├── Hafta13_Sec1_02052019.py ├── Hafta2_Sec2_14022019.py ├── Hafta4_Sec1_28022019.py └── PythonKernel_IlkOrnek-checkpoint.ipynb /Sec.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/Sec.txt -------------------------------------------------------------------------------- /FormHafta6_14022019.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019.zip -------------------------------------------------------------------------------- /TelafiDersi_Sec2_19032019.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/TelafiDersi_Sec2_19032019.py -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nesne Tabanlı Programlama 2 | 3 | ## 2018 - 2019 Bahar Dönemi Nesne Tabanlı Programlama Ders Notları (Python) 4 | 5 | -------------------------------------------------------------------------------- /Nesne Tabanlı Programlama Projesi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/Nesne Tabanlı Programlama Projesi.pdf -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | dfdf119b67ff0412fbc2f19385c19c96ad872b13 2 | -------------------------------------------------------------------------------- /Python Proje Konu Başlık Önerileri.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/Python Proje Konu Başlık Önerileri.docx -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/bin/Debug/FormHafta6_14022019.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/bin/Debug/FormHafta6_14022019.exe -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/bin/Debug/FormHafta6_14022019.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/bin/Debug/FormHafta6_14022019.pdb -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.exe -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.pdb -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.Form1.resources -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.Properties.Resources.resources -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmihran/NesneTabanliProgramlama/HEAD/FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/bin/Debug/FormHafta6_14022019.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Moduller_Sec2/modulum.py: -------------------------------------------------------------------------------- 1 | """ 2 | İki sayının toplamını ve üç sayının toplamını hesaplayan fonksiyonlar barındırır 3 | """ 4 | 5 | liste=[5,3,2,1,10,7] 6 | 7 | def toplam2(s1,s2): 8 | """ 9 | İki sayının toplamını hesaplar 10 | """ 11 | return s1+s2 12 | def toplam3(s1,s2,s3): 13 | """ 14 | Üç sayının toplamını hesaplar 15 | """ 16 | return s1+s2+s3 17 | -------------------------------------------------------------------------------- /Moduller/dortislem.py: -------------------------------------------------------------------------------- 1 | """ 2 | Bu modül dört işlem gerçekleştirir 3 | """ 4 | 5 | def toplama(s1,s2): 6 | """ 7 | İki sayının toplamını döndürür 8 | """ 9 | return s1+s2 10 | def cikarma(s1,s2): 11 | """ 12 | İki sayının farkını döndürür 13 | """ 14 | return s1-s2 15 | def carpma(s1,s2): 16 | """ 17 | İki sayının çarpımını döndürür 18 | """ 19 | return s1*s2 20 | def bolme(s1,s2): 21 | """ 22 | İki sayının bölümünü döndürür 23 | """ 24 | return s1/s2 -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace FormHafta6_14022019 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// Uygulamanın ana girdi noktası. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Moduller/ilkmodulum.py: -------------------------------------------------------------------------------- 1 | """ 2 | 1. Girilen sayının asal sayı olup olmadığını bulup asal ise True, asal değil ise False değerini döndüren fonksiyon 3 | 2. 1 ile 100 arasındaki asal sayıları bir listede tutup bu listeyi geri döndüren fonksiyon 4 | """ 5 | 6 | def asal(sayi): 7 | durum=True 8 | if sayi<=1: 9 | durum=False 10 | else: 11 | for i in range(2,sayi): 12 | if sayi%i==0: 13 | durum=False 14 | break 15 | return durum 16 | 17 | def asalsayilar(): 18 | liste=list() #liste=[] #boş liste tanımlanır 19 | for i in range(1,101): 20 | if asal(i): 21 | liste.append(i) 22 | return liste -------------------------------------------------------------------------------- /Moduller_Sec2/dortislem.py: -------------------------------------------------------------------------------- 1 | """ 2 | Soru 2. İki parametre alan toplama(s1,s2), çıkarma(s1,s2), çarpma(s1,s2) ve bölme(s1,s2) fonksiyonlarına sahip (toplama, çıkarma, çarpma, bölme işlemlerini hesaplatan) dortislem isimli modül oluşturalım ve projemize import edip fonksiyonları test edelim 3 | """ 4 | def toplama(s1,s2): 5 | """ 6 | İki sayının toplamını döndürür 7 | """ 8 | return s1+s2 9 | def cikarma(s1,s2): 10 | """ 11 | İki sayının farkını döndürür 12 | """ 13 | return s1-s2 14 | def carpma(s1,s2): 15 | """ 16 | İki sayının çarpımını döndürür 17 | """ 18 | return s1*s2 19 | def bolme(s1,s2): 20 | """ 21 | İki sayının bölümünü döndürür 22 | """ 23 | return s1/s2 24 | -------------------------------------------------------------------------------- /Tutorials.adoc: -------------------------------------------------------------------------------- 1 | Öğreticiler / Tutorials 2 | 3 | https://www.w3schools.com/python/default.asp 4 | 5 | https://www.w3schools.com/python/exercise.asp?filename=exercise_syntax1 6 | 7 | http://www.asimsinanyuksel.com/ 8 | 9 | https://www.youtube.com/results?search_query=python&sp=EgIQAw%253D%253D 10 | 11 | https://www.youtube.com/watch?v=fHJU_T4kQE8&list=PLK6Whnd55IH5rbIrl61H2l-560LddyHO5 12 | 13 | https://www.youtube.com/watch?v=6fr3Ppmyh08&list=PLK6Whnd55IH69pMFZb1pZB3OX1KIKwd19 14 | 15 | https://www.youtube.com/watch?v=tWj9zpdBAx0&list=PLK6Whnd55IH5i1klkNSBDasIaO77l-Bm9 16 | 17 | https://www.youtube.com/watch?v=hOuIKC8LsB4 18 | 19 | https://www.youtube.com/watch?v=R75Oo--O5Q4&list=PLIHume2cwmHehcxQE1XZieL21syR3m3tR 20 | 21 | https://www.youtube.com/watch?v=c1IW9S2bR2w&list=PLib7LoYR5PuDxi8TxxGKxMgf8b-jtoS3i&index=1 22 | -------------------------------------------------------------------------------- /Moduller/hesaplama.py: -------------------------------------------------------------------------------- 1 | """ 2 | Burada sayı toplama, büyük sayı hesaplama gibi işlemler yer almaktadır. 3 | """ 4 | 5 | sayilar=[3,6,2,8,4,5,10] 6 | 7 | def toplama2(s1,s2): 8 | """ 9 | İki sayının toplamını geri döndürür 10 | """ 11 | return s1+s2 12 | 13 | def toplama3(s1,s2,s3): 14 | """ 15 | Üç sayının toplamını geri döndürür 16 | """ 17 | return s1+s2+s3 18 | 19 | def buyuksayi(s1,s2): 20 | """ 21 | İki sayı içerisindeki büyük sayıyı geri döndürür 22 | """ 23 | if s1>s2: 24 | return s1 25 | elif s1s2: 37 | return s2 38 | else: 39 | return 0 40 | -------------------------------------------------------------------------------- /Moduller/sayitahmin.py: -------------------------------------------------------------------------------- 1 | """ 2 | Modul - sayitahmin 3 | 1. fonk (sayiuret)-> 10 tane 1 ile 30 arasında sayı üreten bir fonksiyon tanımlanacak 4 | 2. fonk (kontrolet)-> Kullanıcının girdiği 5 değer, bu üretilen 10 sayının içinde var mı kontrol etsin ve olanları bir listede tutsun. time ile 1 sn bekletip "Kontrol ediliyor" çıktısını verelim 5 | time.sleep(1) -> 1 sn. bekler 6 | 3. fonk (yazdir)-> Doğru bilmiş olduğu değerlerin listesini ekrana yazdırsın 7 | """ 8 | def sayiuret(): 9 | import random 10 | rastgele=[] 11 | for i in range(10): 12 | rastgele.append(random.randint(1,30)) 13 | print(rastgele) 14 | return rastgele 15 | def kontrolet(kullaniciliste): 16 | rastgelesayilar=sayiuret() 17 | kontrollistesi=[] 18 | for i in kullaniciliste: 19 | if i in rastgelesayilar: 20 | kontrollistesi.append(i) 21 | return kontrollistesi 22 | def yazdir(liste): 23 | print(kontrolet(liste)) -------------------------------------------------------------------------------- /ErsinHocaOrnek.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Mar 18 11:17:41 2019 4 | 5 | @author: ersinşahin 6 | """ 7 | 8 | f=open("11.txt","r+",encoding="utf-8") 9 | a=f.read() 10 | a=list(a) 11 | 12 | b=[] 13 | 14 | for i in a: 15 | if i==" " or i=="\n": 16 | a.remove(i) 17 | 18 | 19 | for i in range(0,len(a)-1): 20 | if i%2==0: 21 | s=str(a[i])+str(a[i+1]) 22 | b.append(s) 23 | 24 | 25 | e=[ [0 for i in range(20) ] for j in range(20) ] 26 | 27 | 28 | o=0 29 | for i in range(0,20): 30 | for j in range(0,20): 31 | e[i][j]=b[o] 32 | o+=1 33 | 34 | s=0 35 | for i in range (1): 36 | for j in range(0,20): 37 | s+=int(e[i][j]) 38 | 39 | c=[] 40 | s1=0 41 | for i in range (0,20): 42 | for j in range(0,17): 43 | s1=int(e[i][j])*int(e[i][j+1])*int(e[i][j+2])*int(e[i][j+3]) 44 | c.append(s1) 45 | 46 | c.sort(reverse=False) 47 | 48 | print(sum(c)) -------------------------------------------------------------------------------- /PythonProjeKonuBaslikOnerileri: -------------------------------------------------------------------------------- 1 | Python Proje Konu Başlık Önerileri 2 | Nesne Tabanlı bir programlama dili ile proje yapılabilir. 3 | 4 | 1.Takip Sistemi (Bir veya birden fazla modül) 5 | Personel 6 | Maaş 7 | Satış 8 | Pazarlama 9 | Üretim 10 | Özlük işleri 11 | Öğrenci 12 | Araç satış 13 | Müşteri 14 | Kütüphane 15 | Eczane 16 | Araç kiralama 17 | Vb. 18 | 2.Web sitesi 19 | 3.Web sitesinin veri tabanı ile bağlantısını kurma 20 | 4.Chat bot 21 | 5.Görüntü işleme 22 | 6.Veri analizi (Veriyi anlamlı hale getirme, atmasyon bir veri de olabilir) 23 | 7.Üyelik sistemi 24 | 8.Oyun yazılımı (İçinde kod barındıran ve internet üzerinden erişemeyeceğim ve basit bir çalışma olmamalı mesela taş kağıt makas olmamalı) 25 | 9.Güvenlik üzerine bir çalışma 26 | Web Sitesi Güvenlik Kontrolleri 27 | 10.Algoritma üzerine analiz 28 | Sıralama algoritma analizi 29 | Ne kadar sürede sıraladı (Hız) 30 | Sıralama adımlarının çıkarımı (Nasıl) 31 | Hafızada ne kadar yer tuttu 32 | 11.Çalıştığı işletim sistemi çözüp bu işletim sistemine göre belli metodları çalıştan uygulama 33 | 12.Yönetim paneli 34 | 13.API Kullanımı 35 | 14.API ile Kare Kod Oluşturma 36 | 15.Basit Bir Blog Sitesi Oluşturma 37 | 16.vb. 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /11.txt: -------------------------------------------------------------------------------- 1 | 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 2 | 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 3 | 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 4 | 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 5 | 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 6 | 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50 7 | 32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70 8 | 67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21 9 | 24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72 10 | 21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95 11 | 78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92 12 | 16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57 13 | 86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58 14 | 19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40 15 | 04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66 16 | 88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69 17 | 04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36 18 | 20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16 19 | 20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54 20 | 01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48 -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.421 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormHafta6_14022019", "FormHafta6_14022019\FormHafta6_14022019.csproj", "{58562B55-80A9-4286-9085-6154BFFA7B29}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {58562B55-80A9-4286-9085-6154BFFA7B29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {58562B55-80A9-4286-9085-6154BFFA7B29}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {58562B55-80A9-4286-9085-6154BFFA7B29}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {58562B55-80A9-4286-9085-6154BFFA7B29}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {37BDBE9E-26ED-4631-8852-E95CCD6298BB} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FormHafta6_14022019.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/obj/Debug/FormHafta6_14022019.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\bin\Debug\FormHafta6_14022019.exe.config 2 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\bin\Debug\FormHafta6_14022019.exe 3 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\bin\Debug\FormHafta6_14022019.pdb 4 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.csprojAssemblyReference.cache 5 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.Form1.resources 6 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.Properties.Resources.resources 7 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.csproj.GenerateResource.cache 8 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.csproj.CoreCompileInputs.cache 9 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.exe 10 | C:\Users\gozdemihranaltinsoy\source\repos\FormHafta6_14022019\FormHafta6_14022019\obj\Debug\FormHafta6_14022019.pdb 11 | -------------------------------------------------------------------------------- /ErsinHocaDersOrnegi.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Mar 18 11:20:43 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | f=open("11.txt","r+",encoding="utf-8") 9 | a=f.read() 10 | #print(a[0]) 11 | 12 | """ 13 | a=str(a) 14 | b=a.split() 15 | print(b) 16 | """ 17 | 18 | a=list(a) 19 | 20 | b=[] 21 | 22 | for i in a: 23 | if i==" " or i=="\n": 24 | a.remove(i) 25 | """ 26 | for i in range(0,len(a)-1,2): 27 | s=str(a[i])+str(a[i+1]) 28 | b.append(s) 29 | """ 30 | 31 | for i in range(0,len(a)-1): 32 | if i%2==0: 33 | s=str(a[i])+str(a[i+1]) 34 | b.append(s) 35 | 36 | #print(b) 37 | 38 | e=[ [0 for i in range(20)] for j in range(20) ] #400 eleman 39 | print(e) 40 | sayac=0 41 | for i in range(0,20): 42 | for j in range(0,20): 43 | e[i][j]=b[sayac] 44 | sayac+=1 45 | print(e) 46 | 47 | 48 | #Matrisin ilk satırının elemanları toplamı 49 | toplam=0 50 | for i in range(0,20): 51 | toplam+=int(e[0][i]) 52 | #string olduğu için int dönüştürdük 53 | print(toplam) 54 | 55 | c=[] 56 | for i in range(0,20): 57 | for j in range (0,17): 58 | carpim=1 59 | for k in range(0,4): 60 | carpim*=int(e[i][j+k]) 61 | c.append(carpim) 62 | #string olduğu için int dönüştürdük 63 | c.sort(reverse=False) 64 | #Küçükten büyüğe sıralar 65 | print(c) 66 | 67 | print(max(c)) 68 | 69 | -------------------------------------------------------------------------------- /Hafta3_Sec2_21022019.py: -------------------------------------------------------------------------------- 1 | #https://repl.it/languages/python3 ile oluţturuldu. 2 | print("Merhaba") 3 | a=10 4 | print(a) 5 | a="Merhaba" 6 | print(a) 7 | print(a[0]) 8 | print(a[0:3]) 9 | print(a[3:5]) 10 | print(a[::2]) 11 | print(a[::-1]) 12 | print(type(a)) 13 | b=10 14 | print(type(b)) 15 | c=4.5 16 | print(type(c)) 17 | d=True 18 | print(type(d)) 19 | a="3.5" 20 | a=float(a) 21 | print(type(a)) 22 | print(int(a)) 23 | print(round(a)) 24 | a=5 25 | b=6 26 | x=a 27 | a=b 28 | b=x 29 | print(a,b) 30 | a,b=b,a 31 | print(a,b) 32 | a,b,c,d=1,2,3,4 33 | print(a,b,c,d) 34 | a=[1,2,3,4,5] 35 | print(type(a)) 36 | a=["Beykoz","2.3",5,True] 37 | print(a[0]) 38 | print(a[0][0]) 39 | print(a[1][0]) 40 | a={1,2,3,4} 41 | print(a) 42 | a.add(10) 43 | print(a) 44 | a.add("Kavacýk") 45 | print(a) 46 | print(5/3) 47 | print(5//3) 48 | print(5%3) 49 | print(5**3) 50 | print(16**(1/2)) 51 | print(16**0.5) 52 | print(8**(1/3)) 53 | a=4 54 | print(-a) 55 | a=-a 56 | print(a) 57 | a='Gözde\'nin bugün dersi var' 58 | print(a) 59 | a='Gözde \t nin bugün dersi var' 60 | print(a) 61 | print(len(a)) 62 | a="Beykoz" 63 | print(a[len(a)-1]) 64 | print(a[-1]) 65 | print(12,34,23,sep=".") 66 | print(12,34,23,sep=" ") 67 | print(21,2,2019,sep="/") 68 | print(21,2,2019,sep="\n") 69 | print(*"Python") 70 | print(*"123") 71 | print(123,212,331,sep=",") 72 | a,b,c=10,10.5,345.234 73 | print("{2} {0} {1}".format(a,b,c)) 74 | print("{:10.2f}".format(a)) 75 | print("{:10.2f}".format(b)) 76 | print("{:10.2f}".format(c)) 77 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Bir bütünleştirilmiş koda ilişkin Genel Bilgiler aşağıdaki öznitelikler kümesiyle 6 | // denetlenir. Bütünleştirilmiş kod ile ilişkili bilgileri değiştirmek için 7 | // bu öznitelik değerlerini değiştirin. 8 | [assembly: AssemblyTitle("FormHafta6_14022019")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("FormHafta6_14022019")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible özniteliğinin false olarak ayarlanması bu bütünleştirilmiş koddaki türleri 18 | // COM bileşenleri için görünmez yapar. Bu bütünleştirilmiş koddaki bir türe 19 | // erişmeniz gerekirse ComVisible özniteliğini o türde true olarak ayarlayın. 20 | [assembly: ComVisible(false)] 21 | 22 | // Bu proje COM'un kullanımına sunulursa, aşağıdaki GUID tür kitaplığının kimliği içindir 23 | [assembly: Guid("58562b55-80a9-4286-9085-6154bffa7b29")] 24 | 25 | // Bir derlemenin sürüm bilgileri aşağıdaki dört değerden oluşur: 26 | // 27 | // Ana Sürüm 28 | // İkincil Sürüm 29 | // Yapı Numarası 30 | // Düzeltme 31 | // 32 | // Tüm değerleri belirtebilir veya varsayılan Derleme ve Düzeltme Numaralarını kullanmak için 33 | // '*' kullanarak varsayılana ayarlayabilirsiniz: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Hafta8_Sec2_04042019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 4 14:32:59 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | #Modüller (Metodlar-Fonksiyonlar) 9 | #Kendisine gönderilen iki sayının toplamını 10 | #ekrana yazdıran fonksiyon 11 | def toplam(sayi1,sayi2): 12 | print("Toplam:",sayi1+sayi2) 13 | 14 | #Kendisine gönderilen iki sayının çarpımını 15 | #metoda geri döndürecek fonksiyon 16 | def carpim(sayi1,sayi2): 17 | return sayi1*sayi2 18 | 19 | #Girilen değerin karesini ekrana yazdıran metod 20 | def kare(): 21 | sayi=int(input("Sayı:")) 22 | print(pow(sayi,2)) 23 | 24 | #Rastgele üretilen 1 ile 20 arasında 10 sayıyı listede tutup, 25 | #bu listenin toplamını geri döndüren metod 26 | def rastgele(): 27 | import random 28 | liste=[] 29 | for i in range(10): #0 ile 9 arasında değer alır,10 kez çalışır 30 | liste.append(random.randint(1,20)) 31 | print(liste) 32 | return sum(liste) 33 | 34 | #Kendisine gönderilen n değeri kadar rastgele kendisine 35 | #gönderilen minimum ve maksimum değerler arasında sayı üretip, 36 | #bu sayıları listede tutarak listeyi geri döndüren metod 37 | def rastgele2(n,kucuk,buyuk): 38 | import random 39 | liste=[] 40 | for i in range(n): #n kere çalışır 41 | liste.append(random.randint(kucuk,buyuk)) 42 | return liste 43 | 44 | def main(): 45 | #%% 46 | toplam(5,10) 47 | s1,s2=int(input("1.sayı:")),int(input("2.sayı:")) 48 | toplam(s1,s2) 49 | print("Çarpım=",carpim(s1,s2)) 50 | #%% 51 | kare() 52 | #%% 53 | print("Toplam:",rastgele()) 54 | #%% 55 | a,b,c=int(input("n:")),int(input("min:")),int(input("mak:")) 56 | sayilar=rastgele2(a,b,c) 57 | print(sayilar) 58 | 59 | #%% 60 | main() 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Hafta9_Sec1_11042019_2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 11 11:16:59 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | #lambda_adi=lambda parametre:dönen_deger(ler) 9 | #parametre fonksiyona dışarıdan gönderilen değer(ler) 10 | 11 | #kendisine gelen sayının 2 katını döndüren fonksiyon 12 | def ikikati(sayi): 13 | return sayi*2 14 | 15 | print(ikikati(3)) 16 | 17 | ikikati2=lambda a:a*2 18 | 19 | print(ikikati2(5)) 20 | 21 | #kendisine gelen sayıyı geri döndüren lambda 22 | x=lambda i:i 23 | 24 | print("D:",x(10)) 25 | #sayının 10 fazlasını ekrana yazdıralım 26 | x2=lambda i:i+10 27 | 28 | print("S+10:",x2(5)) 29 | 30 | #kendisine gelen 2 sayının toplamını hesaplatan lambda 31 | t=lambda s1,s2:s1+s2 32 | 33 | print("T:",t(15,10)) 34 | 35 | #iki sayının birbirine bölümünden kalanı hesaplayan lambda 36 | 37 | k=lambda x,y:x%y 38 | 39 | print("Kalan:",k(10,3)) 40 | 41 | #iki sayının birbirine bölümünü hesaplayan lambda 42 | 43 | b=lambda x,y:int(x/y) 44 | 45 | print("Bölüm:",b(10,3)) 46 | 47 | #kendisine gönderilen listedeki en büyük değeri döndüren lambda 48 | mak=lambda i:max(i) 49 | 50 | liste=[10,5,3,7,8,100] 51 | print("mak:",mak(liste)) 52 | 53 | #kendisine gönderilen metni tersten yazdıran lambda 54 | ters=lambda a:a[::-1] 55 | 56 | print(ters("Beykoz")) 57 | 58 | #kendisine gönderilen metnin 5. harfi ile 6. harfini geri döndüren lambda 59 | 60 | p=lambda a:a[4:6] 61 | 62 | print(p("Beykoz")) 63 | 64 | #girilen sayının tek veya çift olduğunu bulan lambda 65 | tç=lambda a:a%2==0 66 | 67 | #sayi=int(input("Sayı:")) 68 | sayi=10 69 | if (tç(sayi)): 70 | print("Çift") 71 | else: 72 | print("Tek") 73 | 74 | #iki sayının çarpımını ekrana yazdıran fonksiyon 75 | def carpim(s1,s2): 76 | return s1*s2 77 | 78 | print("Ç:",carpim(5,2)) 79 | 80 | 81 | -------------------------------------------------------------------------------- /Hafta9_Sec1_11042019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 11 09:47:35 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | """ 8 | #Belirli bir sayı aralılığında(fonksiyon) 9 | sayigir(): 10 | return sayilar -> sayi1,sayi2 11 | """ 12 | 13 | def sayigir(): 14 | s1,s2=int(input("Min:")),int(input("Mak:")) 15 | if (s1>s2): 16 | s1,s2=s2,s1 17 | #Kullanıcı ilk değeri daha büyük bir sayı girdiğinde bu değerler yer değiştirir. Bunu yapmazsak asalsayi metodunda for i döngüsü çalışmaz. Ör: Kullanıcı s1:10 ve s2:-100 girerse bu yer değiştirme adımı ile s1:-100 s2:10 değerini alır. 18 | return s1,s2 19 | """ 20 | #Asal sayıları bulup listede tutup ekrana yazdıracak(fonksiyon) 21 | asalsayi(): 22 | sayilar=sayigir() 23 | return liste 24 | """ 25 | def asalsayi(): 26 | s1,s2=sayigir() 27 | liste=[] 28 | for i in range(s1,s2+1): 29 | #sayımızın (i) asal olup olmadığını kontrol edelim: 30 | #asal sayı: 1 ve kendisi dışında böleni olmayan sayıdır 31 | kontrol=True #asal sayı olduğunu tutar 32 | #kontrol true ise sayı asaldır. ilk aşamada sayının asal olduğunu kabul edelim 33 | for j in range(2,i): 34 | #j sayının tam bölünüp bölünemediğini kontrol edeceğimiz sayı; i j sayısına bölünüyor mu? 35 | #Bölünüyorsa asal değildir 36 | if (i%j==0): 37 | kontrol=False 38 | break 39 | #if i<2: 40 | # kontrol=False 41 | #if kontrol: 42 | # liste.append(i) 43 | if kontrol and i>=2: 44 | liste.append(i) 45 | print(liste) 46 | return liste 47 | 48 | """ 49 | #Toplamını hesaplayıp(fonksiyon) 50 | toplam(): 51 | liste=asalsayi() 52 | """ 53 | def toplam(): 54 | t=sum(asalsayi()) 55 | return t 56 | """ 57 | #main içersinde toplam değeri yazdıracağız 58 | main(): 59 | print(toplam()) 60 | """ 61 | def main(): 62 | print("Toplam değer:",toplam()) 63 | 64 | main() 65 | -------------------------------------------------------------------------------- /Hafta9_Sec2_11042019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 11 14:10:10 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | def toplam(): 9 | a,b=5,2 10 | return a+b 11 | #kendisine gelen 2 sayının toplamını geri döndüren fonksiyon 12 | def t(s1,s2): 13 | return s1+s2 14 | #listedeki değerlerden en büyük değeri geri döndüren fonksiyon 15 | def mak(): 16 | liste=[5,10,2,3,20,15] 17 | return liste,max(liste) 18 | #Girilen değerin karesini ekrana yazdıran fonksiyon 19 | def kare(): 20 | #s=int(input("Sayı:")) 21 | s=10 22 | print("Karesi:",pow(s,2)) 23 | #Kendisine gönderilen sayının fonksiyonda girilen değere göre üssünü hesaplayıp ekrana yazdıran fonksiyon 24 | def us(s): 25 | u=int(input("Us:")) 26 | print(s,"^",u,":",pow(s,u)) 27 | #Bir sayının asal sayı olup olmadığını ekrana yazdıran fonksiyon asayi() 28 | def asayi(): 29 | sayi=2 30 | kontrol=True #ilk aşamada sayı asal olarak düşünülür 31 | #asal sayı: 1 ve kendisinden başka böleni olmayan sayılardır. 32 | #Öyleyse 2 ile kendisine kadar olan (kendisi dahil değil) sayılara bölünüyor mu diye bakarız 33 | for i in range(2,sayi): 34 | if sayi%i==0: 35 | kontrol=False 36 | break 37 | if kontrol and sayi>=2: 38 | print("Sayı asaldır") 39 | else: 40 | print("Sayı asal değildir") 41 | 42 | #İki sayı girişi alan fonksiyon: sayigir() 43 | def sayigir(): 44 | s1,s2=int(input("Min:")),int(input("Mak:")) 45 | if (s1>s2): 46 | s1,s2=s2,s1 47 | return s1,s2 48 | #sayigir() fonksiyonunda girilen değerler arasındaki değerlerden asal sayıları listeye atayan fonksiyon asalsayi() 49 | def asalsayi(): 50 | mn,mk=sayigir() 51 | liste=[] #liste=list() 52 | for sayi in range(mn,mk+1): 53 | kontrol=True 54 | for i in range(2,sayi): 55 | if sayi%i==0: 56 | kontrol=False 57 | break 58 | if kontrol and sayi>=2: 59 | liste.append(sayi) 60 | yazdir2(liste) 61 | return liste 62 | 63 | #asalsayi() fonksiyonunda üretilen listeyi ekrana yazdıran fonksiyon yazdir() 64 | def yazdir(): 65 | print(asalsayi()) 66 | def yazdir2(liste): 67 | print(liste) 68 | tliste(liste) 69 | #listenin toplamını yazdıracak fonksiyon toplam() 70 | def tliste(liste): 71 | print("Toplam:",sum(liste)) 72 | 73 | def main(): 74 | print(toplam()) 75 | print(t(5,2)) 76 | l,m=mak() 77 | print("Liste:",l,"\nMak:",m) 78 | print("Liste & Mak:",mak()) 79 | kare() 80 | #sayi=int(input("Sayı:")) 81 | #us(sayi) 82 | #asayi() 83 | yazdir() 84 | main() 85 | -------------------------------------------------------------------------------- /Hafta7_Sec1_21032019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Mar 21 09:30:21 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | print("3'e ve 7'ye tam bölünenler:") 8 | #1 ile 100 arasında sadece 3'e ve 7'ye tam bölünenleri ekrana yazdıralım 9 | #listeye aktararak liste boyutunu ekrana yazdıralım 10 | liste=[] #liste tanımlandı 11 | for i in range(1,101): #1 ile 100 arasındaki sayılar. 12 | #Son değerin 1 fazlası yazılır 13 | if(i%3==0 and i%7==0): 14 | print(i) 15 | liste.append(i) #i değerini listeye ekler. 16 | print("Sayıların miktarı:",len(liste)) 17 | print("Sayıların toplamı:",sum(liste),"\n") 18 | 19 | print("5'e veya 8'e tam bölünenler:") 20 | #1 ile 100 arasında 5'e veya 8'e tam bölünenleri ekrana yazdıralım 21 | #sayaç ile bu değerlerin miktarını bulalım 22 | sayac=0 23 | toplam=0 24 | for i in range(1,101): 25 | if(i%5==0 or i%8==0): 26 | print(i) 27 | sayac+=1 28 | toplam+=i 29 | print("Sayıların miktarı:",sayac) 30 | print("Sayıların toplamı:",toplam,"\n") 31 | 32 | #Pop örneği; örnek w3schools platformundan alındı. 33 | fruits = ['apple', 'banana', 'cherry'] 34 | fruits.pop(1) #1.indisteki değeri siler 35 | print(fruits,"\n") 36 | 37 | #Çarpım tablosu 38 | #aralarda tab boşluğu var 39 | #1*1=1 2*1=2 3*1=3 4*1=4 5*1=5 40 | #1*2=2 2*2=4......................5*2=10 41 | #.......................................... 42 | #1*10=10 2*10=20 3*10=30 4*10=40 5*10=50 43 | 44 | ders="Nesne Tabanlı Programlama" 45 | #ders isimli değişkendeki "Tabanlı" metnini 46 | #ekrana yazdırmak için gerekli olan kod satırını yazınız 47 | print(ders[6:13]) #son karakter:13-1=12.indis 48 | 49 | #ders isimli değişkendeki Programlama metninden Pgmm 50 | #ekrana yazdırmak için gerekli olan kod satırını yazınız 51 | print(ders[14::3]) 52 | 53 | #ders isimli değişkenin tuttuğu değeri tersten yazdıralım 54 | print(ders[::-1]) 55 | 56 | #ders isimli değişkendeki "Nesne" metnini 57 | #ekrana yazdırmak için gerekli olan kod satırını yazınız 58 | print(ders[0:5:]) 59 | 60 | #ders isimli değişkenin tuttuğu değerin içinde geçen 61 | #a harflerinin indis değerini ekrana yazdıralım ve 62 | #listede tutup en sonunda listeyi de yazdıralım 63 | #sayac mantığı ile çözüm: 64 | sayac=0 65 | liste=[] 66 | for i in ders: 67 | if (i=="A" or i=="a"): 68 | liste.append(sayac) 69 | print("İndis değeri=",sayac) 70 | sayac+=1 71 | print(liste) 72 | print(type(i)) #str 73 | print(type(sayac)) #int 74 | print(type(liste)) #list 75 | #range ile çözüm: 76 | liste2=[] #boş bir liste2 isimli list tanımladık 77 | for i in range(0,len(ders)): #a int 78 | if ders[i]=="a" or ders[i]=='A': 79 | print("İndis değeri:",i) 80 | liste2.append(i) 81 | print(liste2) 82 | 83 | sehir="İstanbul" 84 | #sehir[0]="I" #bu kod satırı hatalıdır 85 | #nedeni; str objeleri herhangi bir karakterleri değiştirilemez 86 | sehir="Istanbul" 87 | 88 | sayi="104567" 89 | print(sayi[2]) 90 | 91 | liste=list("Gözde") 92 | print(liste) 93 | liste[1]="o" 94 | print(liste) 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Hafta1_Sec2_07022019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Feb 7 14:03:18 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | 7 | """ 8 | 9 | #Bu bir açıklama satırıdır 10 | """ 11 | Bu bir açıklama bloğudur 12 | """ 13 | print("Merhaba Dünya") 14 | a=10 15 | isim="Gözde" 16 | ondalıklısayı=10.5 17 | """ 18 | sayı=int(input("Bir sayı girin:")) 19 | o_sayı=float(input("Sayı:")) 20 | sayı=eval(input("Sayı:")) 21 | 22 | isim=input("İsminiz:") 23 | print("Merhaba",isim) 24 | 25 | sayı=eval(input("Sayı:")) 26 | kare=sayı*sayı 27 | print("Karesi:",kare) 28 | print("Karesi:%d"%kare) 29 | küp=sayı*sayı*sayı 30 | print("Sayı:%d Karesi:%d Küpü:%d"%(sayı,kare,küp)) 31 | print("Sayı:%f Karesi:%f Küpü:%f"%(sayı,kare,küp)) 32 | print("Sayı:%0.2f Karesi:%0.2f Küpü:%0.2f"%(sayı,kare,küp)) 33 | print("Sayı :%10.1f\nKaresi:%10.1f\nKüpü :%10.1f"%(sayı,kare,küp)) 34 | 35 | sayı=eval(input("Sayı:")) 36 | if(sayı>0): 37 | print(sayı) 38 | print("Sayı pozitif") 39 | elif(sayı<0): 40 | print(sayı) 41 | print("Sayı negatif") 42 | else: 43 | print(sayı) 44 | print("Sayı sıfır") 45 | 46 | if(sayı%2==0): 47 | print("Sayı çift") 48 | else: 49 | print("Sayı tek") 50 | 51 | if(sayı==0): 52 | print("Sayı sıfır ve çift") 53 | elif(sayı>0 and sayı%2==0): 54 | print("Sayı pozitif ve çift") 55 | elif(sayı>0): 56 | print("Sayı pozitif ve tek") 57 | elif(sayı%2==0): 58 | print("Sayı negatif ve çift") 59 | else: 60 | print("Sayı negatif ve tek") 61 | if(sayı>0 and (sayı%2==0 or sayı%3==0)): 62 | print(sayı) 63 | """ 64 | 65 | #Klavyeden metre cinsinden girilen uzunluğu 66 | #seçilen birime dönüştüren program 67 | #Seçenekler: 1-mm 2-cm 3-dm 4-km ? 68 | #mm=1000*uzunluk 69 | #cm=100*uzunluk 70 | #dm=10*uzunluk 71 | #km=uzunluk/1000 72 | """ 73 | uzunluk=eval(input("Uzunluk:")) 74 | print("1-mm 2-cm 3-dm 4-km") 75 | seçim=eval(input("Seçiminiz:")) 76 | if(seçim==1): 77 | print(uzunluk*1000,"mm") 78 | elif(seçim==2): 79 | print(uzunluk*100,"cm") 80 | elif(seçim==3): 81 | print(uzunluk*10,"dm") 82 | elif(seçim==4): 83 | sonuç=uzunluk/1000 84 | print(int(sonuç),"km") 85 | else: 86 | print("Hatalı seçim") 87 | """ 88 | #İdeal kiloyu hesaplayan program 89 | #Beden kütle indeksi: kilo/((boy*boy)/10000) 90 | 91 | #Boy(cm) ve cinsiyet klavyeden girilecek 92 | #Kadın: Yöntem1 --> 45.5+2.3*(boy/2.54-60) 93 | #Erkek: Yöntem1 --> 50+2.3*(boy/2.54-60) 94 | #Yaş klavyeden girilecek 95 | #Kadın: Yöntem2 --> (boy-100+yaş/10)*0.8 96 | #Erkek: Yöntem2 --> (boy-100+yaş/10)*0.9 97 | boy=eval(input("Boy:")) 98 | cinsiyet=input("Cinsiyet:") 99 | cinsiyet=cinsiyet.upper() 100 | #upper --> bütün karakterleri büyük harfe dönüştürür 101 | #lower --> bütün karakterleri küçük harfe dönüştürür 102 | yaş=eval(input("Yaş:")) 103 | if(cinsiyet=="KADIN" or cinsiyet=="K"): 104 | idealkilo=45.5+2.3*(boy/2.54-60) 105 | idealkilo2=(boy-100+yaş/10)*0.8 106 | print(idealkilo,"\n",idealkilo2) 107 | elif(cinsiyet=="ERKEK" or cinsiyet=="E"): 108 | idealkilo=50+2.3*(boy/2.54-60) 109 | idealkilo2=(boy-100+yaş/10)*0.9 110 | print(idealkilo,"\n",idealkilo2) 111 | else: 112 | print("Hatalı Giriş") 113 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Bu kod bir araç tarafından oluşturuldu. 4 | // Çalışma Zamanı Sürümü: 4.0.30319.42000 5 | // 6 | // Bu dosyada yapılan değişiklikler yanlış davranışa yol açabilir ve şu durumda kaybolur 7 | // kod yeniden oluşturulduğunda. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FormHafta6_14022019.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Yerelleştirilmiş dizeleri vs. aramak için türü kesin belirlenmiş bir kaynak sınıfı. 17 | /// 18 | // Bu sınıf, StronglyTypedResourceBuilder tarafından otomatik olarak 19 | // ResGen ya da Visual Studio gibi bir araç ile oluşturuldu. 20 | // Bir üye eklemek ya da kaldırmak için .ResX dosyanızı düyenleyin, sonra da ResGen 21 | // öğesini /str seçeneğiyle yeniden çalıştırın veya VS projenizi yeniden derleyin. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Bu sınıf tarafından kullanılan, önbelleğe alınmış ResourceManager örneğini döndürür. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FormHafta6_14022019.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Geçerli iş parçacığının CurrentUICulture özelliğini, türü kesin belirlenmiş 56 | /// bu kaynak sınıfını kullanan tüm kaynak aramaları için geçersiz kılar. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Hafta13_Sec2_02052019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu May 2 14:14:48 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | #%% 8 | import modulum 9 | print(modulum.toplam2(5,2)) 10 | print(modulum.toplam3(3,2,1)) 11 | print(help(modulum)) 12 | modulum.liste.sort() 13 | print(modulum.liste) 14 | #%% 15 | from modulum import * 16 | print(toplam2(10,2)) 17 | print(liste) 18 | #%% 19 | import modulum as islem 20 | islem.liste.sort(reverse=True) 21 | print(islem.liste) 22 | #%% 23 | import math 24 | print(help(math)) #fonksiyonları, dataları açıklamalarıyla listeler 25 | print(dir(math)) #fonksiyonları listeler 26 | 27 | print(math.ceil(5.4)) #yukarı yuvarlar 28 | print(math.floor(10.6)) #aşağı yuvarlar 29 | print(math.factorial(5)) #faktöriyeli getirir 30 | 31 | #%% 32 | #Soru 1. Math modülündeki fonksiyonları kullanarak bir hesap makinesi geliştirelim 33 | #1.Yukarı yuvarla (ceil) 34 | #2.Aşağı yuvarla (floor) 35 | #3.Faktöriyel(factorial) 36 | #4.Üs alma (pow) 37 | #5.Karekök alma (sqrt) 38 | #6.Çıkış 39 | import math 40 | while True: 41 | print(""" 42 | 1.Yukarı yuvarla (ceil) 43 | 2.Aşağı yuvarla (floor) 44 | 3.Faktöriyel(factorial) 45 | 4.Üs alma (pow) 46 | 5.Karekök alma (sqrt) 47 | 6.Çıkış""") 48 | secim=int(input("Seçiminiz:")) 49 | if secim==6: 50 | break 51 | sayi=eval(input("Sayı:")) 52 | if secim==1: 53 | print(math.ceil(sayi)) 54 | elif secim==2: 55 | print(math.floor(sayi)) 56 | elif secim==3: 57 | print(math.factorial(sayi)) 58 | elif secim==4: 59 | us=eval(input("Us:")) 60 | print(math.pow(sayi,us)) 61 | elif secim==5: 62 | print(math.sqrt(sayi)) 63 | else: 64 | print("Hatalı seçim...") 65 | #%% 66 | #Soru 2. İki parametre alan toplama(s1,s2), çıkarma(s1,s2), çarpma(s1,s2) ve bölme(s1,s2) fonksiyonlarına sahip (toplama, çıkarma, çarpma, bölme işlemlerini hesaplatan) dortislem isimli modül oluşturalım ve projemize import edip fonksiyonları test edelim 67 | from dortislem import * 68 | print(toplama(5,2)) 69 | print(cikarma(5,2)) 70 | print(carpma(5,2)) 71 | print(bolme(5,2)) 72 | 73 | #print(bolme(5,0)) 74 | #print(bolme(5,"a")) 75 | 76 | try: 77 | print(bolme(5,0)) 78 | except: 79 | print("Hatalı işlem") 80 | 81 | try: 82 | print(bolme(5,"a")) 83 | except: 84 | print("Hatalı işlem") 85 | 86 | try: 87 | print(bolme(5,0)) 88 | except ZeroDivisionError: 89 | print("Sıfıra bölünme hatası var") 90 | 91 | try: 92 | print(bolme(5,"a")) 93 | except TypeError: 94 | print("Tip uyuşmazlığı hatası var") 95 | 96 | try: 97 | print(bolme(5,"a")) 98 | print(bolme(5,2)) #hatalı koddan sonraki try adımları çalışmaz 99 | except ZeroDivisionError: 100 | print("Sıfıra bölünme hatası var") 101 | except TypeError: 102 | print("Tip uyuşmazlığı hatası var") 103 | finally: 104 | print("Bu bölüm çalıştı...") 105 | 106 | 107 | try: 108 | sayi1,sayi2=int(input("Sayi:")),int(input("Sayi:")) 109 | print(dortislem.toplama(sayi1,sayi2)) 110 | except ValueError: 111 | print("Geçersiz değer girdiniz...") 112 | #Kullanıcı geçersiz bir değer girerse program buraya dallanır 113 | 114 | #Kullanıcı geçerli bir değer girine kadar kullanıcıdan değer isteyelim... -------------------------------------------------------------------------------- /Hafta6_Sec2_14032019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Mar 14 16:15:22 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | isim=input("İsminizi giriniz:") 9 | #Girilen ismin 2. karakterinden 5. karakterine kadar 10 | #ekrana çıktısını veren kodu yazınız. 11 | print(isim[1:5]) 12 | 13 | #Girilen ismin içinde a harfi var mı diye 14 | #kontrolünü gerçekleştiren kodu yazınız 15 | #kelimenin tüm harflerini kontrol edelim: 16 | for i in isim: 17 | if (i=="a" or i=="A"): 18 | print("A harfi var") 19 | else: 20 | print("A harfi yok") 21 | #Girilen ismin içinde a harfi var mı diye 22 | #kontrolünü gerçekleştiren kodu yazınız 23 | #kelimenin tamamını kontrol edelim: (Çıktı 1 kere oluşur) 24 | print("Kelime Kontrol") 25 | kontrol=0 26 | for i in isim: 27 | if (i=="a" or i=="A"): 28 | kontrol=1 29 | if (kontrol==1): 30 | print("A harfi var") 31 | else: 32 | print("A harfi yok") 33 | 34 | #Girilen ismin içinde a harfinin kaçıncı sıralarda olduğunun 35 | #ve a harfinin miktarının çıktısını verecek olan program 36 | sayac=0 37 | for i in range(0,len(isim)) : 38 | #son değer:len(isim) değerinin 1 eksiği 39 | if (isim[i]=="a" or isim[i]=="A"): 40 | print(i+1) 41 | sayac+=1 42 | print("Miktarı:",sayac) 43 | 44 | #Girilen iki sayının birbirine tam bölünüp bölünemediğinin 45 | #çıktısını veren kodu yazınız 46 | #Mod alma : % işareti ile kontrol edilir 47 | #Eğer mod sonucu 0 ise tam bölünebilir 48 | sayı1=int(input("1.sayı:")) 49 | sayı2=int(input("2.sayı:")) 50 | if (sayı1%sayı2==0 or sayı2%sayı1==0): 51 | print("Tam bölünebilir") 52 | else: 53 | print("Tam bölünemez") 54 | 55 | #Klavyeden girinin para miktarını banknotlara ayıran programı 56 | #yazınız. 200,100,50,20,10,5,1 57 | para=int(input("Para tutarını giriniz:")) 58 | sayac=0 59 | while(para>=200): 60 | sayac+=1 61 | para-=200 62 | print("200 banknot:",sayac) 63 | sayac=0 64 | while(para>=100): 65 | sayac+=1 66 | para-=100 67 | print("100 banknot:",sayac) 68 | sayac=0 69 | while(para>=50): 70 | sayac+=1 71 | para-=50 72 | print("50 banknot:",sayac) 73 | sayac=0 74 | while(para>=20): 75 | sayac+=1 76 | para-=20 77 | print("20 banknot:",sayac) 78 | sayac=0 79 | while(para>=10): 80 | sayac+=1 81 | para-=10 82 | print("10 banknot:",sayac) 83 | sayac=0 84 | while(para>=5): 85 | sayac+=1 86 | para-=5 87 | print("5 banknot:",sayac) 88 | print("1 banknot:",para) 89 | 90 | 91 | 92 | #Girilen günün haftanın kaçıncı günü olduğunu veren program 93 | #Ör/ Kullanıcı Pazartesi girdiğinde 1, 94 | #ÖR/ Kullanıcı Pazar girdiğinde 7 çıktısını verecek 95 | günler={"Pazartesi":1,"Salı":2,"Çarşamba":3,"Perşembe":4,"Cuma":5,"Cumartesi":6,"Pazar":7} 96 | gün=input("Günü giriniz:").title() 97 | print(gün) 98 | print(günler[gün]) 99 | 100 | #Verilen hece sayısı kadar random bir kelime oluşturacak 101 | #Ör/ Kullanıcı 5 girerse; pumaya 102 | #Ör/ Kullanıcı 3 girerse; leke 103 | sesliharfler=["a","e","ı","i","o","ö","u","ü"] 104 | #Sesli harf miktarı:8 105 | sessizharfler=["b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","y","z"] 106 | #Sessiz harf miktarı:18 107 | 108 | miktar=int(input("Hece sayısını giriniz:")) 109 | kelime=[] 110 | for i in range(0,miktar): 111 | import random 112 | rndSessiz=sessizharfler[random.randint(0,17)] 113 | kelime.append(rndSessiz) 114 | rndSesli=sesliharfler[random.randint(0,7)] 115 | kelime.append(rndSesli) 116 | print(kelime) 117 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace FormHafta6_14022019 12 | { 13 | public partial class Form1 : Form 14 | { 15 | public Form1() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void btnTikla_Click(object sender, EventArgs e) 21 | { 22 | 23 | MessageBox.Show("Merhaba", "Hoşgeldin", MessageBoxButtons.OK, MessageBoxIcon.Information); 24 | 25 | } 26 | 27 | private void btnGiris_Click(object sender, EventArgs e) 28 | { 29 | MessageBox.Show("Merhaba " + txtAdi.Text); 30 | } 31 | 32 | private void btnKontrol_Click(object sender, EventArgs e) 33 | { 34 | try 35 | { 36 | int parola = Int16.Parse(txtParola.Text); 37 | //parola = Convert.ToInt16(txtParola.Text); 38 | //İki tanımlama da int türüne dönüştürür 39 | string ad = txtKullanici.Text; 40 | 41 | 42 | if (ad == "admin" && parola == 123) 43 | { 44 | MessageBox.Show("Giriş Başarılı"); 45 | } 46 | else 47 | MessageBox.Show("Giriş Başarısız"); 48 | } 49 | catch (Exception) 50 | { 51 | 52 | MessageBox.Show("Lütfen geçerli bir değer giriniz"); 53 | } 54 | 55 | } 56 | 57 | private void btnHesapla_Click(object sender, EventArgs e) 58 | { 59 | int sayi1 = Convert.ToInt16(txtSayi1.Text); 60 | int sayi2 = Convert.ToInt16(txtSayi2.Text); 61 | 62 | txtToplam.Text = (sayi1+sayi2).ToString(); 63 | } 64 | 65 | private void btnHesapla2_Click(object sender, EventArgs e) 66 | { 67 | try 68 | { 69 | bool kontrol = true; 70 | int sayi1 = Convert.ToInt16(txtS1.Text); 71 | int sayi2 = Convert.ToInt16(txtS2.Text); 72 | int sonuc = 0; 73 | if (rbTopla.Checked) 74 | sonuc = sayi1 + sayi2; 75 | else if (rbCarp.Checked) 76 | sonuc = sayi1 * sayi2; 77 | else if (rbCikar.Checked) 78 | sonuc = sayi1 - sayi2; 79 | else if (rbBol.Checked) 80 | sonuc = sayi1 / sayi2; 81 | else 82 | kontrol = false; 83 | 84 | if (!kontrol) //kontrol==false 85 | MessageBox.Show("seçim yapınız"); 86 | else 87 | txtT.Text = sonuc.ToString(); 88 | } 89 | catch(DivideByZeroException) 90 | { 91 | MessageBox.Show("Sayı sıfıra bölünemez.","Hata",MessageBoxButtons.OK,MessageBoxIcon.Error); 92 | } 93 | catch(FormatException) 94 | { 95 | MessageBox.Show("Sayı girişi yapınız.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); 96 | } 97 | catch (Exception) 98 | { 99 | MessageBox.Show("Yönetici ile iletişime geçiniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); 100 | 101 | } 102 | 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Hafta9_Sec2_11042019_2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 11 16:09:39 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | #iki sayının bölümünün sonucunu döndüren fonksiyon 9 | def bolum(): 10 | return 10/2 11 | 12 | #kendisine gelen değeri geri döndüren lambda 13 | a=lambda s:s 14 | 15 | #kendisine gelen değerlerin bölümünü döndüren lambda 16 | b=lambda a,b:int(a/b) 17 | 18 | #kendisine gelen 2 tane sayının birbirine bölümünden kalanını veren lambda 19 | kalan=lambda x,y:x%y 20 | 21 | #kendisini gelen sayının 2 katını geri döndüren lambda 22 | ikikati=lambda x:2*x 23 | 24 | #kendisini gelen sayının karesini geri döndüren lambda 25 | kare=lambda a:pow(a,2) 26 | 27 | #kendisini gelen sayının, kendisine gelen üssünü geri döndüren lambda 28 | us=lambda a,b:pow(a,b) 29 | 30 | #kendisine gönderilen listeden en büyük sayıyı döndüren lambda 31 | mak=lambda liste:max(liste) 32 | 33 | #kendisine gönderilen listeden sayıların toplamlarını döndüren lambda 34 | toplam=lambda liste:sum(liste) 35 | 36 | #kendisine gönderilen metni tersten yazdıran lambda 37 | ters=lambda isim:isim[::-1] 38 | 39 | #kendisine gönderilen metnin 5. ve 6. harflerini ekrana yazdıran lambda 40 | p=lambda isim:isim[4:6] 41 | 42 | #Kendisine gelen sayının tek veya çift olduğunu döndüren lambda 43 | tekçift=lambda sayi:sayi%2==0 44 | 45 | #Kendisine gelen değer 2'den küçükse 1 değerini, değilse 5 değerini döndüren lambda 46 | x = lambda y: 1 if y < 2 else 5 47 | 48 | #Kendisine gelen sayının tek veya çift olduğunun sonucunu yazdıran lambda 49 | tç=lambda a: print("çift") if a%2==0 else print("tek") 50 | 51 | #Kendisine gönderilen sayıların tek veya çift olduğunu ekrana yazdıran lambda 52 | tç2=lambda i: print(i,":çift") if i%2==0 else print(i,":tek") 53 | 54 | #Kendisine gönderilen 5 adet sayının toplamını döndüren lambda 55 | t=lambda a,b,c,d,e:a+b+c+d+e 56 | 57 | #Kendisine gönderilen isimleri Z'den A'ya sıralayan lambda 58 | sirala=lambda isimler:sorted(isimler,reverse=True) 59 | 60 | #Kendisine gönderilen isimleri A'dan Z'ye sıralayan lambda 61 | sirala2=lambda isimler:sorted(isimler) 62 | 63 | #kendisine gönderilen listedeki isimlerin karakter sayısına bakarak kısa kelimeden uzun kelimeye doğru sıralayan fonksiyon 64 | def ksirala(): 65 | #Soru mimarı: Doğukan Dombaycı 66 | yeniliste=list() 67 | isimler=["Aslı","Doğukan","Akın","Zeynep","Süleyman","Kaan","Sezer","Beyza","Ada"] 68 | uzunluk=[] 69 | for i in isimler: 70 | uzunluk.append(len(i)) 71 | print(uzunluk) 72 | #Çözüm mimarı: Okan Kukul 73 | for i in range(1,max(uzunluk)+1): 74 | for j in range(0,len(isimler)): 75 | if (len(isimler[j])==i): 76 | yeniliste.append(isimler[j]) 77 | print(yeniliste) 78 | 79 | """ 80 | #Değerleri ekrana yazdıralım 81 | for i in range(0,len(isimler)): 82 | print(isimler[i]) 83 | #Değerleri ekrana yazdıralım 84 | for i in isimler: 85 | print(i) 86 | """ 87 | def main(): 88 | print("Bolum:",bolum()) 89 | print(b(10,3)) 90 | print(a(2)) 91 | k=kalan(10,3) 92 | print(k) 93 | print(ikikati(5)) 94 | print(kare(6)) 95 | print(us(5,3)) 96 | liste=[5,10,20,15,30,78,40] 97 | print("Mak:",mak(liste)) 98 | print("Toplam:",toplam(liste)) 99 | print(ters("Beykoz")) 100 | print(p("Beykoz")) 101 | #sayi=int(input("sayı:")) 102 | sayi=10 103 | if tekçift(sayi): 104 | print("Sayı çifttir") 105 | else: 106 | print("Sayı tektir") 107 | print(x(2)) 108 | tç(5) 109 | for i in range(1,10): 110 | tç2(i) 111 | print("T:",t(1,2,3,4,5)) 112 | isimler=["Aslı","Akın","Zeynep","Kaan","Sezer","Beyza"] 113 | print(sirala(isimler)) 114 | print(sirala2(isimler)) 115 | ksirala() 116 | main() 117 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/FormHafta6_14022019.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {58562B55-80A9-4286-9085-6154BFFA7B29} 8 | WinExe 9 | FormHafta6_14022019 10 | FormHafta6_14022019 11 | v4.6.1 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | Form1.cs 59 | 60 | 61 | ResXFileCodeGenerator 62 | Resources.Designer.cs 63 | Designer 64 | 65 | 66 | True 67 | Resources.resx 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Hafta1_Sec1_07022019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Feb 7 09:30:00 2019 4 | 7 Şubat 2019 09:00 - 13:00 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | 9 | print("Merhaba") 10 | a=10 11 | print("a=",a) 12 | 13 | değişken=float(input("değişken=")) 14 | kare=değişken*değişken 15 | print("Karesi:",kare,kare,"Karesi:",kare) 16 | print("Karesi:",kare) 17 | 18 | değişken2=int(input("değişken2=")) 19 | kare2=değişken2*değişken2 20 | print("Karesi:",kare2) 21 | 22 | isim=input("İsminiz:") 23 | print("Merhaba ",isim) 24 | 25 | ondalıklısayı=eval(input("Sayı:")) 26 | print(ondalıklısayı*2) 27 | isim=eval(input("İsim:")) 28 | print(isim*2) 29 | 30 | a=10.2545678 31 | print("%d"%a) #Bu ekrana yazdırırken integer olarak yazdırır 32 | #Yani değişkenin tipini değiştirmez 33 | b=int(a) #Değişkenin tipini(türünü) integer yapar 34 | print(a) 35 | c=255.6545478 36 | d=2125.241548 37 | print("%10.2f"%a) 38 | print("%10.2f"%b) 39 | print("%10.2f"%c) 40 | print("%10.2f"%d) 41 | print("Değerleri yan yana yazdıralım:") 42 | print(a,b,c,d) 43 | print("Değerleri alt alta yazdıralım:") 44 | print(a,"\n",b,"\n",c,"\n",d) 45 | print("%d\n%d\n%d\n%d\n"%(a,b,c,d)) 46 | 47 | sayı=eval(input("Sayı:")) 48 | if (sayı>0): 49 | print(sayı) 50 | print("Sayı pozitif") 51 | elif (sayı<0): 52 | print(sayı) 53 | print("Sayı negatif") 54 | else: 55 | print(sayı) 56 | print("Sayı sıfır") 57 | if(sayı%2==0): 58 | print("Sayı çifttir") 59 | else: 60 | print("Sayı tektir") 61 | 62 | if(sayı==0): 63 | print("Sayı sıfır ve çift") 64 | elif(sayı>0 and sayı%2==0): 65 | print("Sayı pozitif ve çift") 66 | elif(sayı>0): 67 | print("Sayı pozitif ve tek") 68 | elif(sayı%2==0): 69 | print("Sayı negatif ve çift") 70 | else: 71 | print("Sayı negatif ve tek") 72 | if(sayı>0 and (sayı%2==0 or sayı%3==0)): 73 | print(sayı) 74 | 75 | #Klavyeden metre cinsinden girilen uzunluğu 76 | #seçilen birime dönüştüren program 77 | #Seçenekler: 1-mm 2-cm 3-dm 4-km ? 78 | #mm=1000*uzunluk 79 | #cm=100*uzunluk 80 | #dm=10*uzunluk 81 | #km=uzunluk/1000 82 | 83 | uzunluk=int(input("Uzunluk(m):")) 84 | print("1-mm 2-cm 3-dm 4-km :?") 85 | seçim=int(input("Seçiminiz:")) 86 | if(seçim==1): 87 | print(uzunluk*1000,"mm") 88 | elif(seçim==2): 89 | print(uzunluk*100,"cm") 90 | elif(seçim==3): 91 | print(uzunluk*10,"dm") 92 | elif(seçim==4): 93 | print(uzunluk/1000,"km") 94 | else: 95 | print("Hatalı seçim") 96 | 97 | 98 | 99 | cinsiyet=input("Cinsiyet:") 100 | cinsiyet=cinsiyet.upper() 101 | #upper --> Metni büyük harfe dönüştürür 102 | #lower --> Metni küçük harfe dönüştürür 103 | if (cinsiyet=="K" or cinsiyet=="KADIN"): 104 | print("Kadın") 105 | else: 106 | print("Erkek") 107 | 108 | #İdeal kiloyu hesaplayan program 109 | #Beden kütle indeksi: kilo/((boy*boy)/10000) 110 | 111 | #Boy(cm) ve cinsiyet klavyeden girilecek 112 | #Kadın: Yöntem1 --> 45.5+2.3*(boy/2.54-60) 113 | #Erkek: Yöntem1 --> 50+2.3*(boy/2.54-60) 114 | #Yaş klavyeden girilecek 115 | #Kadın: Yöntem2 --> (boy-100+yaş/10)*0.8 116 | #Erkek: Yöntem2 --> (boy-100+yaş/10)*0.9 117 | 118 | boy=eval(input("Boyunuz:")) 119 | cinsiyet=input("Cinsiyet:") 120 | cinsiyet=cinsiyet.upper(); 121 | #Girilen cinsiyet değeri büyük harfe dönüştü 122 | yaş=eval(input("Yaşınız:")) 123 | if(cinsiyet=="KADIN" or cinsiyet=="K"): 124 | idealkilo=45.5+2.3*(boy/2.54-60) 125 | idealkilo2=(boy-100+yaş/10)*0.8 126 | else: 127 | idealkilo=50+2.3*(boy/2.54-60) 128 | idealkilo2=(boy-100+yaş/10)*0.9 129 | print("ideal kilonuz:",idealkilo) 130 | print("İdeal kilo:",idealkilo2) 131 | kilo=eval(input("Kilo:")) 132 | print("Vücut kitle indeksi:",kilo/((boy*boy)/10000)) 133 | 134 | """ 135 | Ödev-1: 136 | Klavyeden girilen pozitif tamsayıyı tersten 137 | yazdıran program 138 | ipucu : sayının mod 10'u alınabilir 139 | 1234 140 | 4321 141 | """ 142 | sayı=1234 143 | print(sayı%10) 144 | print(int(sayı/10)) 145 | """ 146 | Ödev-2: 147 | Klavyeden girilen sayının tamsayı olup 148 | olmadığını bulan program 149 | ipucu : sayıyı tamsayıya dönüştürüp kendisine 150 | eşit mi diye karşılaştırmak 151 | """ 152 | -------------------------------------------------------------------------------- /Hafta8_Sec1_04042019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 4 09:42:45 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | #Modüller (Metodlar - Fonksiyonlar) 8 | #Kendisine gönderilen iki sayının toplamını hesaplayan metod: 9 | 10 | def toplam(sayi1,sayi2): 11 | return sayi1+sayi2 12 | 13 | #Kendisine gönderilen sayının faktöriyelini hesaplayan metod: 14 | def faktoriyel(sayi): 15 | f=1 16 | for i in range(1,sayi+1): #1'den sayi değerine kadar 17 | f*=i 18 | return f 19 | 20 | #Sayının karesini ekrana yazdıran metod: 21 | def kare(): 22 | sayi=int(input("Sayı giriniz..:")) 23 | print(pow(sayi,2)) 24 | 25 | #Kendisine gönderilen sayı ve üs değerlerine göre üssünü hesaplayıp 26 | #ekrana yazdıran metod: 27 | def us(sayi,us): 28 | print(pow(sayi,us)) 29 | 30 | #Rastgele 1 ile 100 arasında üretilen 10 sayının toplamını döndüren (return) metod: 31 | def rast(): 32 | import random 33 | liste=[] 34 | for i in range(1,11): 35 | liste.append(random.randint(1,100)) 36 | print(liste) 37 | print("Mak:",max(liste)) 38 | print("Min:",min(liste)) 39 | return sum(liste) 40 | 41 | #10 sayısının 3 sayısına bölümünden kalanı ekrana yazdıran metod: 42 | def kalan(): 43 | print(s1%s2) 44 | 45 | #Kendisine gönderilen değer kadar kendisine gönderilen 46 | #min ve mak değerler arasında random değer üretip 47 | #bu değerleri ana metoda döndüren metod: 48 | #Parametre 3 değer, döndürülen random değerler (liste) 49 | def rastgele(n,mn,mk): 50 | import random 51 | sayilar=[] 52 | for i in range(n): 53 | sayilar.append(random.randint(mn,mk)) 54 | return sayilar 55 | 56 | 57 | 58 | def taskagitmakas(): 59 | print("1.Taş 2.Kağıt 3.Makas") 60 | 61 | #Kullanıcıya 3 seçenek gösterelim 62 | #1. seçeneği tercih ederse; 63 | #Taş kağıt makas oyununu yazdığımız metodu çağırsın 64 | #2. seçeneği tercih ederse 65 | #1.Listeyi görüntüleme 66 | #2.Global bir listeye değer ekleme (liste metoddan önce ve dışında tanımlanacak) 67 | #3.Listeden seçilen değeri silme 68 | #4.Listeyi A'dan Z'ye sıralama 69 | #3. seçeneği tercih ederse 70 | #Çıkış 71 | liste=["Beykoz","Sarıyer","Usküdar","Kadıköy","Mecidiyeköy","Istinye"] 72 | 73 | def menu(): 74 | while(True): 75 | print("1-Taş Kağıt Makas Oyunu\n2-Liste\n3-Çıkış") 76 | secim=int(input("Seçiminiz:")) 77 | if (secim==1): 78 | taskagitmakas() 79 | elif (secim==2): 80 | print("1-Liste Görüntüleme\n2-Ekleme\n3-Silme\n4-Sıralama") 81 | secim2=int(input("Seçiminiz:")) 82 | if (secim2==1): 83 | print(liste) 84 | elif (secim2==2): 85 | liste.append(input("Şehir giriniz:")) 86 | elif (secim2==3): 87 | print(liste,"\n kaçıncı değeri silmek istersiniz?:") 88 | a=int(input("Değer no:")) 89 | liste.pop(a-1) 90 | print(liste) 91 | elif (secim2==4): 92 | liste.sort() 93 | print(liste) 94 | else: 95 | print("Hatalı seçim") 96 | elif (secim==3): 97 | break 98 | else: 99 | print("Hatalı seçim") 100 | 101 | s1=10 102 | s2=3 103 | def main(): 104 | # %% 105 | print(toplam(5,10)) 106 | 107 | # %% 108 | sayi=int(input("Faktöriyeli alınacak sayıyı giriniz..:")) 109 | print(faktoriyel(sayi)) 110 | 111 | # %% 112 | kare() 113 | 114 | # %% 115 | us(5,4) 116 | 117 | # %% 118 | toplam=rast() 119 | print("Toplam:",toplam) 120 | 121 | # %% 122 | print(s1+s2) 123 | 124 | # %% 125 | kalan() 126 | 127 | # %% 128 | liste=rastgele(5,10,15) 129 | #5 tane değer üret, değerler 10 ile 15 arasında olsun 130 | print(liste) 131 | 132 | # %% 133 | a,b,c=int(input("n:")),int(input("mn:")),int(input("mk:")) 134 | liste=rastgele(a,b,c) 135 | #a tane değer üret, değerler b ve c aralığında olsun 136 | print(liste) 137 | 138 | # %% 139 | menu() 140 | 141 | # %% 142 | main() 143 | 144 | -------------------------------------------------------------------------------- /TelafiDersi_Sec1_15032019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Mar 15 14:00:02 2019 4 | 5 | Section 1 Telafi Dersi 6 | 7 | @author: gozdemihranaltinsoy 8 | """ 9 | 10 | #Girilen ismin 2. karakterinden 5. karakterine kadar 11 | #ekrana çıktısını veren kodu yazınız. 12 | isim=input("İsim giriniz:") 13 | print(isim[1:5]) 14 | #İlk karakterinden 4. karakterine kadar 15 | print(isim[:4]) #4'ün bir eksiğine kadar gider 16 | 17 | #Girilen ismin içinde a harfi var mı diye 18 | #kontrolünü gerçekleştiren kodu yazınız 19 | #kelimenin tüm harflerini kontrol edelim: 20 | for i in isim: 21 | if (i=="a" or i=="A"): 22 | print("A harfi var") 23 | else: 24 | print("A harfi yok") 25 | 26 | #Girilen ismin içinde a harfi var mı diye 27 | #kontrolünü gerçekleştiren kodu yazınız 28 | #kelimenin tamamını kontrol edelim: (Çıktı 1 kere oluşur) 29 | print("Kontrol:") 30 | kontrol=0 31 | for i in isim: 32 | if (i=="a" or i=="A"): 33 | kontrol=1 34 | if (kontrol): 35 | print("A harfi var") 36 | else: 37 | print("A harfi yok") 38 | 39 | #Girilen ismin içinde a harfinin kaçıncı sıralarda olduğunun 40 | #ve a harfinin miktarının çıktısını verecek olan program 41 | sayaç=0 42 | for i in range(len(isim)): 43 | if (isim[i]=="a" or isim[i]=="A"): 44 | print(i+1) 45 | sayaç+=1 46 | print("Miktarı:",sayaç) 47 | 48 | #Girilen iki sayının birbirine tam bölünüp bölünemediğinin 49 | #çıktısını veren kodu yazınız 50 | #Mod alma : % işareti ile kontrol edilir 51 | #Eğer mod sonucu 0 ise tam bölünebilir 52 | sayi1=int(input("1.sayı:")) 53 | sayi2=int(input("2.sayı:")) 54 | if (sayi1%sayi2==0 or sayi2%sayi1==0): 55 | print("Tam bölünebilir") 56 | else: 57 | print("Tam bölünemez") 58 | 59 | #Klavyeden girinin para miktarını banknotlara ayıran programı 60 | #yazınız. 200,100,50,20,10,5,1 61 | ilkpara=int(input("Para tutarı:")) 62 | para=ilkpara 63 | banknot=0 64 | while(para>=200): 65 | banknot+=1 66 | para-=200 67 | print("200 banknot:",banknot) 68 | banknot=0 69 | while(para>=100): 70 | banknot+=1 71 | para-=100 72 | print("100 banknot:",banknot) 73 | banknot=0 74 | while(para>=50): 75 | banknot+=1 76 | para-=50 77 | print("50 banknot:",banknot) 78 | banknot=0 79 | while(para>=20): 80 | banknot+=1 81 | para-=20 82 | print("20 banknot:",banknot) 83 | banknot=0 84 | while(para>=10): 85 | banknot+=1 86 | para-=10 87 | print("10 banknot:",banknot) 88 | banknot=0 89 | while(para>=5): 90 | banknot+=1 91 | para-=5 92 | print("5 banknot:",banknot) 93 | print("1 banknot",para) 94 | 95 | print("Diğer çözüm:") 96 | #Diğer çözüm: 97 | #ilkpara paramızın miktarını tutuyor 98 | para=ilkpara 99 | banknot=0 100 | if (para>=200): 101 | banknot=int(para/200) 102 | para%=200 103 | print("200 banknot:",banknot) 104 | banknot=0 105 | if (para>=100): 106 | banknot=int(para/100) 107 | para%=100 108 | print("100 banknot:",banknot) 109 | banknot=0 110 | if (para>=50): 111 | banknot=int(para/50) 112 | para%=50 113 | print("50 banknot:",banknot) 114 | banknot=0 115 | if (para>=20): 116 | banknot=int(para/20) 117 | para%=20 118 | print("20 banknot:",banknot) 119 | banknot=0 120 | if (para>=10): 121 | banknot=int(para/10) 122 | para%=10 123 | print("10 banknot:",banknot) 124 | banknot=0 125 | if (para>=5): 126 | banknot=int(para/5) 127 | para%=5 128 | print("5 banknot:",banknot) 129 | print("1 banknot:",para) 130 | 131 | #Girilen günün haftanın kaçıncı günü olduğunu veren program 132 | #Ör/ Kullanıcı Pazartesi girdiğinde 1, 133 | #ÖR/ Kullanıcı Pazar girdiğinde 7 çıktısını verecek 134 | #sözlük yapısını kullanıyoruz: 135 | #farklı çözümlerde kullanılabilir 136 | 137 | günler={"Pazartesi":1,"Salı":2,"Çarşamba":3,"Perşembe":4,"Cuma":5,"Cumartesi":6,"Pazar":7} 138 | gün=input("Gün:").title() 139 | #title girilen kelimenin baş harfini büyük harf, diğer harflerini küçük harf yapar 140 | print(günler[gün],".gün") 141 | 142 | 143 | #Verilen hece sayısı kadar random bir kelime oluşturacak 144 | #Ör/ Kullanıcı 3 girerse; pumaya 145 | #Ör/ Kullanıcı 2 girerse; leke 146 | 147 | sesli=["a","e","ı","i","o","ö","u","ü"] 148 | #sesli harf miktarı:8 149 | sessiz=["b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","y","z"] 150 | #sessiz harf miktarı:18 151 | randomkelime=[] 152 | rndkelime="" 153 | hece=int(input("Hece:")) 154 | import random 155 | for i in range(hece): 156 | rndsessiz=random.choice(sessiz) 157 | randomkelime.append(rndsessiz) 158 | #diğer yöntem 159 | #rndsesli=sessiz[random.randint(0,17)] 160 | 161 | rndsesli=random.choice(sesli) 162 | randomkelime.append(rndsesli) 163 | #diğer yöntem: 164 | #rndsesli=sesli[random.randint(0,7)] 165 | 166 | #diğer yöntem: 167 | rndkelime=rndkelime+rndsessiz+rndsesli 168 | print(randomkelime) 169 | print(rndkelime) 170 | -------------------------------------------------------------------------------- /Hafta4_Sec2_28022019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Feb 28 14:17:51 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | """ 9 | Klavyeden girilen bir kelimeyi, her harfinden sonra sırasını 10 | gösteren sayıyı da yanına koyarak tekrar ekrana yazdıran 11 | programı Python diliyle kodlayınız. 12 | Ör: Beykoz kelimesi klavyeden girildiğinde; 13 | B1e2y3k4o5z6 şeklinde çıktı verecektir. 14 | """ 15 | 16 | kelime=input("Bir kelime giriniz:") 17 | #print(type(kelime)) 18 | liste=[] 19 | for i in range(0,len(kelime)): 20 | liste.append(kelime[i]) 21 | liste.append(i+1) 22 | print(liste) 23 | 24 | 25 | """ 26 | Klavyeden girilen kelimenin içinde bulunan sesli harflerden 27 | kaç tane bulunduğunun çıktısını veren programı Python 28 | diliyle kodlayınız. 29 | Ör: Beykoz Üniversitesi 30 | e->3 31 | i->3 32 | o->1 33 | ü->1 34 | 35 | Ör: Bilgisayar 36 | a-->2 37 | i-->2 38 | """ 39 | 40 | 41 | kelime=input("Bir kelime giriniz:") 42 | sesliharfler=["a","e","ı","i","o","ö","u","ü"] 43 | miktar=[] 44 | liste=[] 45 | for i in kelime: 46 | if (i in sesliharfler): 47 | liste.append(i) 48 | print(liste) 49 | for i in range(0,len(sesliharfler)): 50 | sayac=0 51 | for j in range(0,len(liste)): 52 | if (sesliharfler[i]==liste[j]): 53 | sayac+=1 54 | miktar.append(sayac) 55 | print(miktar) 56 | for i in range(0,len(miktar)): 57 | if (miktar[i]!=0): 58 | print(sesliharfler[i],"-->",miktar[i]) 59 | 60 | """ 61 | Taş - Kağıt - Makas Oyunu 62 | Bilgisayar taş, kağıt ve makas değerlerinden 63 | birini random olarak seçecek (metin veya sayı 64 | ile tutabilirsiniz). Oyun aşağıda belirtmiş 65 | olduğum kurallara göre gerçekleşecek. 66 | 67 | Taş-kâğıt-makas, genellikle iki oyuncuyla ve 68 | üç durumdan birinin seçilmesiyle oynanan bir 69 | el oyunudur. Taş makası, makas kağıdı, kâğıt da 70 | taşı yener. Eğer oyuncular aynı durumu seçerse 71 | oyun berabere biter. 72 | 73 | Kazanma 74 | Taş, makası kırarak yener. 75 | Kağıt, taşı sararak yener. 76 | Makas, kağıdı keserek yener. 77 | 78 | Belirlenen skora ilk ulaşan oyunu kazanır. İstenirse tek seferli oyunlar da oynanabilir. 79 | 80 | Hak ve skor planlamasını da dilediğiniz gibi yapabilirsiniz. 81 | 82 | Açıklama: Python'da random sayı üretmek için; 83 | 84 | import random #random sınıfını projenize 85 | dahil eder 86 | 87 | sayı=random.randint(1,3) #1 ile 3 arasında 88 | random bir sayı üretip bu sayıyı sayı değişkenine 89 | atar. 90 | """ 91 | #Yenme durumları 92 | #1-2 93 | #3-1 94 | #2-3 95 | 96 | import random 97 | pcskor=0 98 | kullanıcıskor=0 99 | 100 | while True:#(kullanıcıskor<3 and pcskor<3): 101 | kullanıcı=int(input("1-Kağıt 2-Taş 3-Makas Seçiminiz:\n")) 102 | 103 | pc=random.randint(1,3) 104 | print("Bilgisayar Seçimi:",pc) 105 | if (kullanıcı==pc): 106 | print("Berabere kaldınız") 107 | elif ((kullanıcı==1 and pc==2) or (kullanıcı==3 and pc==1) or (kullanıcı==2 and pc==3)): 108 | print("Tebrikler. Kazandınız.") 109 | kullanıcıskor+=1 110 | elif ((kullanıcı==2 and pc==1) or (kullanıcı==1 and pc==3) or (kullanıcı==3 and pc==2)): 111 | print("Üzgünüm. Yenildiniz.") 112 | pcskor+=1 113 | else: 114 | print("Hatalı seçim") 115 | print("Skor durumu: \n Pc-->",pcskor," Kullanıcı skor-->",kullanıcıskor) 116 | if (kullanıcıskor==3 or pcskor==3): 117 | break 118 | if (kullanıcıskor>pcskor): 119 | print("Oyun Bitti! Tebrikler yendiniz...") 120 | else: 121 | print("Oyun Bitti! Yenildiniz...") 122 | 123 | 124 | 125 | """ 126 | Adam Asmaca Oyunu 127 | Kelimeler arasından rastgele seçim yapılacak 128 | Kullanıcı kelimelerin harflerini bulmaya çalışacak 129 | """ 130 | 131 | #6 harfli kelimeler listesi oluşturalım 132 | import random 133 | kelimeler=["KİTAP","KALEM","SİLGİ","LİSTE","ÇOCUK","TAHTA","YASİN","KASAP","GÖZDE","FIRIN","EKMEK"] 134 | print(len(kelimeler)) 135 | hak=3 136 | liste=["_","_","_","_","_"] 137 | rastgele=kelimeler[random.randint(0,10)] #11 değer var 138 | #rastgele="KİLİT" #deneme 139 | print(rastgele) 140 | 141 | while True: 142 | tahmin=input("Tahmini harfinizi giriniz:") 143 | durum=False 144 | for i in range(0,len(rastgele)): #i değeri indisi tutar 145 | #for i in rastgele --> i kelimenin harfleri olurdu 146 | if (tahmin==rastgele[i]): 147 | liste[i]=tahmin 148 | durum=True 149 | if (durum): 150 | print(liste) 151 | else: 152 | hak-=1; 153 | sonuc=True 154 | for i in liste: 155 | if (i=="_"): 156 | sonuc=False 157 | break 158 | if (hak==0 or sonuc==True): 159 | break 160 | if (sonuc==True): 161 | print("Bildiniz... Kelime:",rastgele) 162 | else: 163 | print("Kaybettiniz... Kelime:",rastgele) 164 | -------------------------------------------------------------------------------- /Hafta2_Sec1_14022019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Feb 14 09:08:27 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | x=input("sayı:") 9 | print(x[::-1]) 10 | 11 | # Girilen sayıyı tersten yazdıran program 12 | 13 | sayı=eval(input("Sayı:")) 14 | while(sayı>0): 15 | print(sayı%10,end="") 16 | #end="" ifadesi değerleri yanyana yazdırdı 17 | sayı=int(sayı/10) 18 | 19 | #Girilen sayının tam sayı olup olmadığını yazdıralım 20 | 21 | sayı=eval(input("Sayı:")) 22 | sayı2=int(sayı) 23 | if(sayı==sayı2): 24 | print("Sayı tamsayıdır.") 25 | else: 26 | print("Sayı tamsayı değildir.") 27 | 28 | #1'den 100'e kadar olan sayılardan 29 | #tek olanları ekrana yazdıralım 30 | 31 | sayı=1 32 | while(sayı<=100): 33 | if(sayı%2==1): 34 | print(sayı) 35 | sayı=sayı+1 36 | 37 | 38 | print(*range(1,100,2)) 39 | 40 | #Girilen 2 sayının birbirine bölünüp 41 | #bölünmediğini veren program 42 | 43 | s1=eval(input("Sayı:")) 44 | s2=eval(input("Sayı:")) 45 | if (s2>s1): 46 | x=s1 47 | s1=s2 48 | s2=x 49 | #Yer değiştirme 50 | if(s1%s2==0): 51 | print("TAM BÖLÜNÜR") 52 | else: 53 | print("TAM BÖLÜNMEZ") 54 | 55 | #Girilen bir sayının tam bölenlerini 56 | #ekrana yazdıran program 57 | 58 | sayı=eval(input("Sayı:")) 59 | sayı=int(sayı) 60 | bol=1 61 | while(sayı+1!=bol): 62 | if(sayı%bol==0): 63 | print(bol) 64 | bol=bol+1 65 | 66 | #2.çözüm yolu 67 | 68 | sayı=eval(input("Sayı:")) 69 | sayı=int(sayı) 70 | for bol in range(1,sayı+1): 71 | if(sayı%bol==0): 72 | print(bol) 73 | 74 | #Bir sayının mükemmel sayı olup olmadığını 75 | #bulan program 76 | #Mükemmel sayı: Kendisi dışında 77 | #kendisine tam bölünen sayıların toplamı 78 | #kendisine eşit olan sayılar 79 | #Mükemmel sayı ör: 6, 28, 496, 8128 80 | 81 | sayı=eval(input("Sayı:")) 82 | sayı=int(sayı) 83 | toplam=0 84 | for bol in range(1,sayı): 85 | #sayının kendisi dahil değildir. 86 | if(sayı%bol==0): 87 | print(bol) 88 | toplam=toplam+bol 89 | if(toplam==sayı): 90 | print("Sayı mükemmel bir sayıdır") 91 | else: 92 | print("Sayı mükemmel bir sayı değildir") 93 | 94 | #Kullanıcıdan alınan 4 kenar bilgisine 95 | #göre şeklin dikdörtgen, kare veya 96 | #diğer dörtgen olduğunu söylesin 97 | 98 | a=input("1.kenar:") 99 | b=input("2.kenar:") 100 | c=input("3.kenar:") 101 | d=input("4.kenar:") 102 | if(a==b==c==d): 103 | print("Şekil karedir.") 104 | #elif((a==b and c==d) or (a==c and b==d) or (a==d and b==c)): 105 | elif(a==b!=c==d or a==c!=b==d or a==d!=b==c): 106 | print("Şekil dikdörtgendir.") 107 | else: 108 | print("Şekil yamuktur.") 109 | 110 | #Çarpım tablosu 111 | """ 112 | 1*1=1 113 | 1*2=2 114 | 1*3=3 115 | ... 116 | 1*10=10 117 | 2*1=2 118 | 2*2=4 119 | ... 120 | ... 121 | 10*10=100 122 | """ 123 | 124 | for i in range(1,11): 125 | for j in range(1,11): 126 | #print("{}*{}={}".format(i,j,i*j)) 127 | print(i,"*",j,"=",i*j) 128 | 129 | 130 | #Girilen ismin harflerini alt alta yazdıran program 131 | isim=input("ismi giriniz:") 132 | for i in isim: 133 | print(i) 134 | print(isim[0]) #İlk harfi yazdırır 135 | print(isim.upper()) 136 | büyükharf=isim.upper() 137 | küçükharf=isim.lower() 138 | ilkharfibüyük=isim.capitalize() 139 | tersinedönüştür=isim.swapcase() 140 | kelimeilkharfbüyüt=isim.title() 141 | print(isim.islower()) 142 | #isim değişkeni küçük harflerden mi oluşuyor 143 | print(isim.isupper()) 144 | #isim değişkeni büyük harflerden mi oluşuyor 145 | print(isim.istitle()) 146 | #isim değişkendeki kelimelerin ilk harfleri 147 | #büyük harflerden mi oluşuyor 148 | print(isim.isspace()) 149 | #isim değişkeni boşluklardan mı oluşuyor kontrolü 150 | print(isim) 151 | print(isim.find("a")) 152 | #verilen karakterin kaçıncı karakterde olduğunu verir 153 | #sadece ilk bulduğunun indisini döndürür 154 | #olmadığı takdirde -1 döndürür 155 | print(isim.replace("a","e")) 156 | #isim değişkeninde a değerinin yerine e değerini getirir 157 | print(isim.replace("a","")) 158 | #isim değişkeninde a değerinin yerine boş karakter getirir 159 | #dolaylı yoldan silmiş oluruz 160 | 161 | print(len(isim)) 162 | #isim değişkenin tuttuğu değerin karakter sayısını verir 163 | 164 | #Girilen bir kelimede tüm "a" harflerinin kaçıncı 165 | #karakter olduğunu veren program 166 | for i in range(0,len(isim)): 167 | #print(isim[i]) 168 | if(isim[i]=="a"): 169 | print(i+1) 170 | #i indisi döndürür, i+1 karakterin kaçıncı 171 | #karakter olduğunu verir 172 | 173 | print(isim.rfind("a")) 174 | #aramaya son karakterden başlar 175 | #sağdan sola doğru arama yapar 176 | 177 | soyadı=input("Soyadı:") 178 | print(isim,soyadı) 179 | 180 | print("*".join(isim)) 181 | #her harften sonra boşluk karakteri ekler 182 | 183 | #Ödev-1 184 | #Kelimenin Palindrom olup olmadığını bulan program 185 | #kelimenin tersten okunuşu kendisiyle aynı mı? 186 | #ör kayak, ey edip adanada pide ye, kek 187 | -------------------------------------------------------------------------------- /Hafta13_Sec1_02052019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu May 2 09:24:00 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | 8 | #%% 9 | import math 10 | print(dir(math)) 11 | print(math.ceil(5.4)) #yukarı yuvarla 12 | print(math.floor(5.7)) #aşağı yuvarla 13 | print(round(5.4)) #yuvarla 14 | print(round(5.7)) #yuvarla 15 | print(math.factorial(5)) 16 | print(help(math)) 17 | 18 | #%% 19 | from math import * 20 | print(ceil(5.4)) 21 | 22 | #%% 23 | import math as matematik 24 | print(matematik.ceil(3.4)) 25 | 26 | #%% 27 | from hesaplama import * 28 | print(toplama2(3,4)) 29 | print(toplama3(5,8,2)) 30 | sayilar.sort() 31 | print(sayilar) 32 | print(buyuksayi(4,6)) 33 | print(kucuksayi(5,7)) 34 | 35 | def toplama2(): 36 | sayi1=int(input("1.sayi:")) 37 | sayi2=int(input("2.sayi:")) 38 | return sayi1+sayi2 39 | 40 | print(toplama2()) 41 | from hesaplama import * 42 | print(toplama2(5,6)) 43 | 44 | 45 | #%% 46 | #Soru 1. Math modülündeki fonksiyonları kullanarak bir hesap makinesi geliştirelim 47 | #1.Yukarı yuvarla (ceil) 48 | #2.Aşağı yuvarla (floor) 49 | #3.Faktöriyel(factorial) 50 | #4.Üs alma (pow) 51 | #5.Karekök alma (sqrt) 52 | #6.Çıkış 53 | 54 | import math 55 | while True: 56 | print(""" 57 | 1.Yukarı yuvarla (ceil) 58 | 2.Aşağı yuvarla (floor) 59 | 3.Faktöriyel(factorial) 60 | 4.Üs alma (pow) 61 | 5.Karekök alma (sqrt) 62 | 6.Çıkış""") 63 | secim=int(input("Seçiniz:")) 64 | if secim==6: 65 | break 66 | sayi=eval(input("Sayi:")) 67 | if secim==1: 68 | print(math.ceil(sayi)) 69 | elif secim==2: 70 | print(math.floor(sayi)) 71 | elif secim==3: 72 | print(math.factorial(sayi)) 73 | elif secim==4: 74 | us=int(input("Us:")) 75 | print(math.pow(sayi,us)) 76 | elif secim==5: 77 | print(math.sqrt(sayi)) 78 | else: 79 | print("Geçersiz seçim...") 80 | 81 | #%% 82 | #Soru 2. İki parametre alan toplama(s1,s2), çıkarma(s1,s2), çarpma(s1,s2) ve bölme(s1,s2) fonksiyonlarına sahip (toplama, çıkarma, çarpma, bölme işlemlerini hesaplatan) dortislem isimli modül oluşturalım ve projemize import edip fonksiyonları test edelim 83 | import dortislem 84 | print(help(dortislem)) 85 | print(dortislem.bolme(5,2)) 86 | try: 87 | print(dortislem.bolme(5,0)) 88 | except: 89 | print("Hatalı işlem") 90 | finally: 91 | print("İşlem devam ediyor...") 92 | try: 93 | print(dortislem.bolme(5,"a")) 94 | except: 95 | print("Hatalı işlem") 96 | finally: 97 | print("İşlem devam ediyor...") 98 | 99 | try: 100 | print(dortislem.bolme(5,"a")) 101 | except ZeroDivisionError: 102 | print("Bir sayı sıfıra bölünemez") 103 | except TypeError: 104 | print("Değerler geçerli değil") 105 | 106 | try: 107 | print(dortislem.bolme(5,0)) 108 | except ZeroDivisionError: 109 | print("Bir sayı sıfıra bölünemez") 110 | except TypeError: 111 | print("Değerler geçerli değil") 112 | 113 | print(dortislem.toplama(4,5)) 114 | print(dortislem.carpma(4,5)) 115 | print(dortislem.cikarma(4,5)) 116 | """ 117 | try: 118 | sayi1,sayi2=int(input("Sayi:")),int(input("Sayi:")) 119 | print(dortislem.toplama(sayi1,sayi2)) 120 | except ValueError: 121 | print("Geçersiz değer girdiniz...") 122 | #Kullanıcı geçersiz bir değer girerse program buraya dallanır 123 | """ 124 | #Kullanıcı geçerli bir değer girine kadar kullanıcıdan değer isteyelim... 125 | while True: 126 | try: 127 | sayi1,sayi2=int(input("Sayi1:")),int(input("Sayi2:")) 128 | print(dortislem.toplama(sayi1,sayi2)) 129 | break #bu kodun çalışabilmesi için kullanıcının geçerli bir sayı girmesi gerekir. Hatalı bir değer girilirse direk except yapısına dallanır 130 | except ValueError: 131 | print("Geçersiz değer girdiniz...") 132 | 133 | #%% 134 | #Bir modül oluşturalım. Modül adı: ilkmodulum 135 | #1. Girilen sayının asal sayı olup olmadığını bulup asal ise True, asal değil ise False değerini döndüren fonksiyon 136 | #2. 1 ile 100 arasındaki asal sayıları bir listede tutup bu listeyi geri döndüren fonksiyon 137 | #import ilkmodulum 138 | 139 | #import ilkmodulum as moduller 140 | #moduller.asal(2) 141 | #artık moduller ismiyle çağırırız 142 | 143 | #import ilkmodulum 144 | #ilkmodulum.asal(2) 145 | #fonksiyonu çağırırken ilkmodulum diye belirtmek zorundayız 146 | 147 | #from ilkmodulum import asal,asalsayilar 148 | #sadece bu iki fonksiyonu projeye dahil eder 149 | 150 | from ilkmodulum import * 151 | if asal(5): 152 | print("Asal") 153 | else: 154 | print("Asal değil") 155 | 156 | asalliste=asalsayilar() 157 | print(asalliste) 158 | 159 | #%% 160 | import hesaplama 161 | print(help(hesaplama)) 162 | 163 | #Sayı tahmin oyunu 164 | 165 | #5 sayı burada girilecek ve 2.fonk (kontrolet) ile tek tek kontrol edilecek 166 | """ 167 | Modul - sayitahmin 168 | 1. fonk (sayiuret)-> 10 tane 1 ile 30 arasında sayı üreten bir fonksiyon tanımlanacak 169 | 2. fonk (kontrolet)-> Kullanıcının girdiği 5 değer, bu üretilen 10 sayının içinde var mı kontrol etsin ve olanları bir listede tutsun. time ile 1 sn bekletip "Kontrol ediliyor" çıktısını verelim 170 | time.sleep(1) -> 1 sn. bekler 171 | 3. fonk (yazdir)-> Doğru bilmiş olduğu değerlerin listesini ekrana yazdırsın 172 | """ 173 | import time 174 | import sayitahmin 175 | liste=[] 176 | for i in range(5): 177 | liste.append(int(input("Sayi:"))) 178 | time.sleep(1) 179 | sayitahmin.yazdir(liste) 180 | -------------------------------------------------------------------------------- /Hafta2_Sec2_14022019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Feb 14 14:05:35 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | """ 8 | # Girilen sayıyı tersten yazdıran program 9 | sayı=eval(input("Sayı:")) 10 | sayı=int(sayı) 11 | while(sayı>0): 12 | print(sayı%10,end="") 13 | sayı=int(sayı/10) 14 | 15 | """ 16 | 17 | """ 18 | sayi=input("Sayi giriniz:") 19 | print(sayi[::-1]) 20 | """ 21 | """ 22 | def reverse(text): 23 | a="" 24 | for i in range(1, len(text)+1): 25 | a+=text[len(text)-i] 26 | return a 27 | 28 | print(reverse(str(input("Bir sayı girin: ")))) 29 | """ 30 | 31 | #Girilen sayının tam sayı olup olmadığını yazdıralım 32 | """ 33 | sayı=eval(input("Sayı:")) 34 | sayı2=int(sayı) 35 | if(sayı==sayı2): 36 | print("Sayı tam sayıdır") 37 | else: 38 | print("Sayı tam sayı değildir") 39 | """ 40 | #1'den 100'e kadar olan sayılardan 41 | #tek olanları ekrana yazdıralım 42 | """ 43 | for i in range(1,101): 44 | if(i%2==1): 45 | print(i) 46 | """ 47 | 48 | #Girilen 2 sayının birbirine bölünüp 49 | #bölünmediğini veren program 50 | """ 51 | s1=eval(input("1.Sayı:")) 52 | s2=eval(input("2.Sayı:")) 53 | if(s2>s1): 54 | x=s1 55 | s1=s2 56 | s2=x 57 | if(s1%s2==0): 58 | print("Tam bölünebilir") 59 | else: 60 | print("Tam bölünemez") 61 | """ 62 | 63 | #Girilen bir sayının tam bölenlerini 64 | #ekrana yazdıran program 65 | """ 66 | sayı=int(eval(input("Sayı:"))) 67 | for i in range(1,sayı+1): 68 | if(sayı%i==0): 69 | print(i) 70 | """ 71 | #2.çözüm yolu: 72 | """ 73 | sayı=int(eval(input("Sayı:"))) 74 | bolen=1 75 | while(bolen<=sayı): 76 | if(sayı%bolen==0): 77 | print(bolen) 78 | bolen+=1 79 | """ 80 | #Bir sayının mükemmel sayı olup olmadığını 81 | #bulan program 82 | #Mükemmel sayı: Kendisi dışında 83 | #kendisine tam bölünen sayıların toplamı 84 | #kendisine eşit olan sayılar 85 | #Mükemmel sayı ör: 6, 28, 496, 8128 86 | """ 87 | sayı=int(eval(input("Sayı:"))) 88 | toplam=0 89 | for i in range(1,sayı): 90 | if(sayı%i==0): 91 | toplam+=i 92 | if(sayı==toplam): 93 | print("Mükemmel sayıdır") 94 | else: 95 | print("Mükemmel sayı değildir") 96 | """ 97 | #Kullanıcıdan alınan 4 kenar bilgisine 98 | #göre şeklin dikdörtgen, kare veya 99 | #diğer dörtgen(yamuk) olduğunu söylesin 100 | #a==b==c==d 101 | #(a==b and c==d) or (a==c and b==d) or (a==d and b==c) 102 | """ 103 | a=input("1.kenar:") 104 | b=input("2.kenar:") 105 | c=input("3.kenar:") 106 | d=input("4.kenar:") 107 | if(a==b==c==d): 108 | print("karedir") 109 | elif(a==b and c==d) or (a==c and b==d) or (a==d and b==c): 110 | #elif(a==b!=c==d) or (a==c!=b==d) or (a==d!=b==c) 111 | print("Dikdörtgendir") 112 | else: 113 | print("Yamuktur") 114 | """ 115 | #Çarpım tablosu 116 | """ 117 | 1*1=1 118 | 1*2=2 119 | 1*3=3 120 | .... 121 | 1*10=10 122 | 2*1=2 123 | ... 124 | ... 125 | 10*10=100 126 | """ 127 | """ 128 | for i in range(1,11): 129 | print("%d'ler Çarpım Tablosu"%i) 130 | for j in range(1,11): 131 | print("{}*{}={}".format(i,j,i*j)) 132 | #print("%d*%d=%d"%(i,j,i*j)) 133 | print("--------------------") 134 | """ 135 | #Girilen ismin harflerini alt alta yazdıran program 136 | isim="Gözde" 137 | for i in isim: 138 | print(i) 139 | print("İlk harf=",isim[0]) 140 | print(len(isim)) 141 | for i in range(0,len(isim)): 142 | print("isim[",i,"]=",isim[i]) 143 | 144 | print(len("Gözde")) 145 | #len metnin uzunluğunu döndürür 146 | print(isim.upper()) 147 | #metnin tamamını büyük harfe dönüştürür 148 | print(isim.lower()) 149 | #metnin tamamını küçük harfe dönüştürür 150 | isim=isim.upper() 151 | #isim içinde tutulan değer büyük harfe dönüştürüldü 152 | print(isim.capitalize()) 153 | #metnin sadece ilk harfini büyük harfe dönüştürür 154 | soyadı="Altınsoy" 155 | adsoyad=isim+" "+soyadı 156 | print(adsoyad.title()) 157 | #kelimelerin ilk harfini büyük harfe dönüştürür 158 | print(adsoyad) 159 | 160 | tersineçevir=adsoyad.swapcase() 161 | #büyük harfi küçük harfe, 162 | #küçük harfi büyük harfe dönüştürür 163 | print(tersineçevir) 164 | print(adsoyad.islower()) 165 | print("gözde".islower()) 166 | #metnin tamamı küçük harf mi kontrol eder 167 | #evetse true, hayırsa false döndürür 168 | print("GÖZDE".isupper()) 169 | #metnin tamamı büyük harf mi kontrol eder 170 | #evetse true, hayırsa false döndürür 171 | print("Gözde".isupper()) 172 | print("Gözde AltınsoY".istitle()) 173 | #sadece kelimelerin ilk harfi büyük mü 174 | #diye kontrol eder 175 | #evetse true, hayırsa false döndürür 176 | print(" ".isspace()) 177 | #metnin tamamı boşluklardan mı oluşuyor 178 | isim=input("İsim:") 179 | print(isim.find("a")) 180 | #ilk bulduğu "a" değerinin indisini döndürür 181 | print(isim.replace("a","e")) 182 | #a harfinin yerine e harfini getir 183 | print(isim.replace("a","")) 184 | 185 | print("istanbul".find("e")) 186 | #karakter yoksa -1 değerini verir 187 | 188 | #Girilen bir kelimede tüm "a" harflerinin kaçıncı 189 | #karakter olduğunu veren program 190 | #ankara 191 | #1,4,6 192 | print("a değerinin bulunduğu karakterler") 193 | for i in range(0,len(isim)): 194 | #if(isim[i].find("a")==0) 195 | if(isim[i]=="a"): 196 | print(i+1) 197 | 198 | print(isim.rfind("a")) 199 | #aramaya son karakterden başlar 200 | #sağdan sola doğru arama yapar 201 | 202 | print("*".join(isim)) 203 | #her harften sonra boşluk karakteri ekler 204 | 205 | #Ödev-1 206 | #Kelimenin Palindrom olup olmadığını bulan program 207 | #kelimenin tersten okunuşu kendisiyle aynı mı? 208 | #ör kayak, ey edip adanada pide ye, kek 209 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Hafta4_Sec1_28022019.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Feb 28 09:05:37 2019 4 | 5 | @author: gozdemihranaltinsoy 6 | """ 7 | """ 8 | Klavyeden girilen bir kelimeyi, her harfinden sonra sırasını 9 | gösteren sayıyı da yanına koyarak tekrar ekrana yazdıran 10 | programı Python diliyle kodlayınız. 11 | Ör: Beykoz kelimesi klavyeden girildiğinde; 12 | B1e2y3k4o5z6 şeklinde çıktı verecektir. 13 | """ 14 | 15 | kelime=input("Bir kelime giriniz:") 16 | kelime2=[] 17 | for i in range(0,len(kelime)): 18 | kelime2.append(kelime[i]) 19 | kelime2.append(i+1) 20 | print(kelime2) 21 | 22 | 23 | """ 24 | Klavyeden girilen kelimenin içinde bulunan sesli harflerden 25 | kaç tane bulunduğunun çıktısını veren programı Python 26 | diliyle kodlayınız. 27 | Ör: Beykoz Üniversitesi 28 | e->3 29 | i->3 30 | o->1 31 | ü->1 32 | 33 | Ör: Bilgisayar 34 | a-->2 35 | i-->2 36 | """ 37 | 38 | 39 | kelime=input("Bir kelime giriniz:") 40 | sesliharfler=["a","e","ı","i","o","ö","u","ü"] 41 | bulunansesliharfler=[] 42 | miktar=[] 43 | for i in range(0,len(kelime)): 44 | if (kelime[i] in sesliharfler): 45 | bulunansesliharfler.append(kelime[i]) 46 | print(bulunansesliharfler) 47 | #kelime 48 | #eie 49 | for i in sesliharfler: 50 | sayac=0 51 | for j in bulunansesliharfler: 52 | if (i==j): 53 | sayac+=1 54 | miktar.append(sayac) 55 | print(miktar) 56 | print(len(miktar)) 57 | 58 | print("Sadece bulunanlar:\n") 59 | for i in range(0,len(miktar)): 60 | if (miktar[i]!=0): 61 | print(sesliharfler[i],"-->",miktar[i]) 62 | print("Tüm Değerler:\n") 63 | for i in range(0,len(miktar)): 64 | print(sesliharfler[i],"-->",miktar[i]) 65 | 66 | 67 | """ 68 | Taş - Kağıt - Makas Oyunu 69 | Bilgisayar taş, kağıt ve makas değerlerinden 70 | birini random olarak seçecek (metin veya sayı 71 | ile tutabilirsiniz). Oyun aşağıda belirtmiş 72 | olduğum kurallara göre gerçekleşecek. 73 | 74 | Taş-kâğıt-makas, genellikle iki oyuncuyla ve 75 | üç durumdan birinin seçilmesiyle oynanan bir 76 | el oyunudur. Taş makası, makas kağıdı, kâğıt da 77 | taşı yener. Eğer oyuncular aynı durumu seçerse 78 | oyun berabere biter. 79 | 80 | Kazanma 81 | Taş, makası kırarak yener. 82 | Kağıt, taşı sararak yener. 83 | Makas, kağıdı keserek yener. 84 | 85 | Belirlenen skora ilk ulaşan oyunu kazanır. İstenirse tek seferli oyunlar da oynanabilir. 86 | 87 | Hak ve skor planlamasını da dilediğiniz gibi yapabilirsiniz. 88 | 89 | Açıklama: Python'da random sayı üretmek için; 90 | 91 | import random #random sınıfını projenize 92 | dahil eder 93 | 94 | sayı=random.randint(1,3) #1 ile 3 arasında 95 | random bir sayı üretip bu sayıyı sayı değişkenine 96 | atar. 97 | 98 | """ 99 | #Yenme Durumları 100 | #2-1 101 | #1-3 102 | #3-2 103 | 104 | import random 105 | kullanıcıskor=0 106 | pcskor=0 107 | while True: 108 | seçim=int(input("Seçiminiz: 1-Taş, 2-Kağıt, 3-Makas :\n")) 109 | pc=random.randint(1,3) 110 | if (seçim==pc): 111 | print("Berabere kaldınız.") 112 | elif ((seçim==2 and pc==1) or (seçim==1 and pc==3) or (seçim==3 and pc==2)): 113 | print("Bilgisayarın kararı:",pc) 114 | print("Tebrikler yendiniz") 115 | kullanıcıskor+=1 116 | elif ((seçim==1 and pc==2) or (seçim==3 and pc==1) or (seçim==2 and pc==3)): 117 | print("Bilgisayarın kararı:",pc) 118 | print("Üzgünüm yenildiniz") 119 | pcskor+=1 120 | else: 121 | print("Hatalı seçim") 122 | print("Skorlar: \nKullanıcı->",kullanıcıskor," PC->",pcskor) 123 | if (kullanıcıskor==3 or pcskor==3): 124 | break 125 | 126 | if (kullanıcıskor>pcskor): 127 | print("Oyun Sona Erdi...TEBRİKLER Yendiniz!") 128 | else: 129 | print("Oyun Sona Erdi...YENİLDİNİZ!") 130 | 131 | 132 | """ 133 | Adam Asmaca Oyunu 134 | Kelimeler arasından rastgele seçim yapılacak 135 | Kullanıcı kelimelerin harflerini bulmaya çalışacak 136 | """ 137 | 138 | 139 | #6 harfli kelimeler listesi oluşturalım 140 | import random 141 | kelimeler=["BEYKOZ","KLAVYE","KELİME","PEYNİR","MATKAP","KOLTUK","GÖZLÜK","PYTHON","ANKARA","YALOVA"] 142 | print("Kelime sayısı:",len(kelimeler)) 143 | rastgele=kelimeler[random.randint(0,9)] 144 | print(rastgele) 145 | kelime=list(rastgele) 146 | print(type(kelime)) 147 | hak=3 148 | #Kullanıcının 8 yanlış yapma hakkı var 149 | while True: 150 | kontrol=False 151 | harf=input("Tahmini Harfiniz:") 152 | for i in range(0,len(rastgele)): 153 | if(rastgele[i]==harf): 154 | kontrol=True 155 | print(i,".değer=",harf) 156 | kelime[i]="-" 157 | if (kontrol==False): 158 | hak-=1 159 | 160 | 161 | """ 162 | KOLTUK 163 | K 164 | -OLTU- 165 | --LTU- 166 | ---TU- 167 | ----U- 168 | ------ 169 | """ 170 | 171 | 172 | durum=True 173 | for i in kelime: 174 | if (i!="-"): 175 | durum=False 176 | break 177 | if(hak==0 or durum==True): 178 | break 179 | if (durum==True): 180 | print("Tebrikler. Bildiniz.Kelime=",rastgele) 181 | else: 182 | print("Bilemediniz.Kelime=",rastgele) 183 | 184 | 185 | #Versiyon 2 186 | #6 harfli kelimeler listesi oluşturalım 187 | import random 188 | kelimeler=["BEYKOZ","KLAVYE","KELİME","PEYNİR","MATKAP","KOLTUK","GÖZLÜK","PYTHON","ANKARA","YALOVA"] 189 | print("Kelime sayısı:",len(kelimeler)) 190 | rastgele=kelimeler[random.randint(0,9)] 191 | print(rastgele) 192 | kelime=["_","_","_","_","_","_"] 193 | print(type(kelime)) 194 | hak=3 195 | #Kullanıcının 8 yanlış yapma hakkı var 196 | while True: 197 | kontrol=False 198 | harf=input("Tahmini Harfiniz:") 199 | for i in range(0,len(rastgele)): 200 | if(rastgele[i]==harf): 201 | kontrol=True 202 | print(i,".değer=",harf) 203 | kelime[i]=rastgele[i] 204 | print(kelime) 205 | if (kontrol==False): 206 | hak-=1 207 | """ 208 | KOLTUK 209 | K 210 | -OLTU- 211 | --LTU- 212 | ---TU- 213 | ----U- 214 | ------ 215 | """ 216 | durum=True 217 | for i in range(0,len(kelime)): 218 | if (kelime[i]!=rastgele[i]): 219 | durum=False 220 | break 221 | if(hak==0 or durum==True): 222 | break 223 | if (durum): 224 | print("Tebrikler. Bildiniz.Kelime=",rastgele) 225 | else: 226 | print("Bilemediniz.Kelime=",rastgele) 227 | -------------------------------------------------------------------------------- /FormHafta6_14022019/FormHafta6_14022019/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace FormHafta6_14022019 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | ///Gerekli tasarımcı değişkeni. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | ///Kullanılan tüm kaynakları temizleyin. 12 | /// 13 | ///yönetilen kaynaklar dispose edilmeliyse doğru; aksi halde yanlış. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer üretilen kod 24 | 25 | /// 26 | /// Tasarımcı desteği için gerekli metot - bu metodun 27 | ///içeriğini kod düzenleyici ile değiştirmeyin. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.btnTikla = new System.Windows.Forms.Button(); 32 | this.btnGiris = new System.Windows.Forms.Button(); 33 | this.txtAdi = new System.Windows.Forms.TextBox(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.txtKullanici = new System.Windows.Forms.TextBox(); 37 | this.btnKontrol = new System.Windows.Forms.Button(); 38 | this.label3 = new System.Windows.Forms.Label(); 39 | this.txtParola = new System.Windows.Forms.TextBox(); 40 | this.label4 = new System.Windows.Forms.Label(); 41 | this.txtSayi2 = new System.Windows.Forms.TextBox(); 42 | this.label5 = new System.Windows.Forms.Label(); 43 | this.txtSayi1 = new System.Windows.Forms.TextBox(); 44 | this.btnHesapla = new System.Windows.Forms.Button(); 45 | this.label6 = new System.Windows.Forms.Label(); 46 | this.txtToplam = new System.Windows.Forms.TextBox(); 47 | this.label7 = new System.Windows.Forms.Label(); 48 | this.txtT = new System.Windows.Forms.TextBox(); 49 | this.label8 = new System.Windows.Forms.Label(); 50 | this.txtS2 = new System.Windows.Forms.TextBox(); 51 | this.label9 = new System.Windows.Forms.Label(); 52 | this.txtS1 = new System.Windows.Forms.TextBox(); 53 | this.btnHesapla2 = new System.Windows.Forms.Button(); 54 | this.rbTopla = new System.Windows.Forms.RadioButton(); 55 | this.rbCikar = new System.Windows.Forms.RadioButton(); 56 | this.rbCarp = new System.Windows.Forms.RadioButton(); 57 | this.rbBol = new System.Windows.Forms.RadioButton(); 58 | this.radioButton5 = new System.Windows.Forms.RadioButton(); 59 | this.radioButton6 = new System.Windows.Forms.RadioButton(); 60 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 61 | this.groupBox2 = new System.Windows.Forms.GroupBox(); 62 | this.groupBox1.SuspendLayout(); 63 | this.groupBox2.SuspendLayout(); 64 | this.SuspendLayout(); 65 | // 66 | // btnTikla 67 | // 68 | this.btnTikla.Location = new System.Drawing.Point(37, 56); 69 | this.btnTikla.Name = "btnTikla"; 70 | this.btnTikla.Size = new System.Drawing.Size(120, 35); 71 | this.btnTikla.TabIndex = 0; 72 | this.btnTikla.Text = "Tıkla"; 73 | this.btnTikla.UseVisualStyleBackColor = true; 74 | this.btnTikla.Click += new System.EventHandler(this.btnTikla_Click); 75 | // 76 | // btnGiris 77 | // 78 | this.btnGiris.Location = new System.Drawing.Point(241, 56); 79 | this.btnGiris.Name = "btnGiris"; 80 | this.btnGiris.Size = new System.Drawing.Size(120, 36); 81 | this.btnGiris.TabIndex = 1; 82 | this.btnGiris.Text = "Giriş"; 83 | this.btnGiris.UseVisualStyleBackColor = true; 84 | this.btnGiris.Click += new System.EventHandler(this.btnGiris_Click); 85 | // 86 | // txtAdi 87 | // 88 | this.txtAdi.Location = new System.Drawing.Point(279, 12); 89 | this.txtAdi.Name = "txtAdi"; 90 | this.txtAdi.Size = new System.Drawing.Size(96, 20); 91 | this.txtAdi.TabIndex = 2; 92 | // 93 | // label1 94 | // 95 | this.label1.AutoSize = true; 96 | this.label1.Location = new System.Drawing.Point(238, 15); 97 | this.label1.Name = "label1"; 98 | this.label1.Size = new System.Drawing.Size(35, 13); 99 | this.label1.TabIndex = 3; 100 | this.label1.Text = "Adınız"; 101 | // 102 | // label2 103 | // 104 | this.label2.AutoSize = true; 105 | this.label2.Location = new System.Drawing.Point(418, 15); 106 | this.label2.Name = "label2"; 107 | this.label2.Size = new System.Drawing.Size(63, 13); 108 | this.label2.TabIndex = 6; 109 | this.label2.Text = "Kullanıcı adı"; 110 | // 111 | // txtKullanici 112 | // 113 | this.txtKullanici.Location = new System.Drawing.Point(487, 12); 114 | this.txtKullanici.Name = "txtKullanici"; 115 | this.txtKullanici.Size = new System.Drawing.Size(96, 20); 116 | this.txtKullanici.TabIndex = 5; 117 | // 118 | // btnKontrol 119 | // 120 | this.btnKontrol.Location = new System.Drawing.Point(448, 77); 121 | this.btnKontrol.Name = "btnKontrol"; 122 | this.btnKontrol.Size = new System.Drawing.Size(120, 36); 123 | this.btnKontrol.TabIndex = 4; 124 | this.btnKontrol.Text = "Kontrol Et"; 125 | this.btnKontrol.UseVisualStyleBackColor = true; 126 | this.btnKontrol.Click += new System.EventHandler(this.btnKontrol_Click); 127 | // 128 | // label3 129 | // 130 | this.label3.AutoSize = true; 131 | this.label3.Location = new System.Drawing.Point(418, 41); 132 | this.label3.Name = "label3"; 133 | this.label3.Size = new System.Drawing.Size(37, 13); 134 | this.label3.TabIndex = 8; 135 | this.label3.Text = "Parola"; 136 | // 137 | // txtParola 138 | // 139 | this.txtParola.Location = new System.Drawing.Point(487, 38); 140 | this.txtParola.Name = "txtParola"; 141 | this.txtParola.Size = new System.Drawing.Size(96, 20); 142 | this.txtParola.TabIndex = 7; 143 | // 144 | // label4 145 | // 146 | this.label4.AutoSize = true; 147 | this.label4.Location = new System.Drawing.Point(41, 166); 148 | this.label4.Name = "label4"; 149 | this.label4.Size = new System.Drawing.Size(39, 13); 150 | this.label4.TabIndex = 13; 151 | this.label4.Text = "2. Sayı"; 152 | // 153 | // txtSayi2 154 | // 155 | this.txtSayi2.Location = new System.Drawing.Point(110, 163); 156 | this.txtSayi2.Name = "txtSayi2"; 157 | this.txtSayi2.Size = new System.Drawing.Size(96, 20); 158 | this.txtSayi2.TabIndex = 12; 159 | // 160 | // label5 161 | // 162 | this.label5.AutoSize = true; 163 | this.label5.Location = new System.Drawing.Point(41, 140); 164 | this.label5.Name = "label5"; 165 | this.label5.Size = new System.Drawing.Size(39, 13); 166 | this.label5.TabIndex = 11; 167 | this.label5.Text = "1. Sayı"; 168 | // 169 | // txtSayi1 170 | // 171 | this.txtSayi1.Location = new System.Drawing.Point(110, 137); 172 | this.txtSayi1.Name = "txtSayi1"; 173 | this.txtSayi1.Size = new System.Drawing.Size(96, 20); 174 | this.txtSayi1.TabIndex = 10; 175 | // 176 | // btnHesapla 177 | // 178 | this.btnHesapla.Location = new System.Drawing.Point(70, 233); 179 | this.btnHesapla.Name = "btnHesapla"; 180 | this.btnHesapla.Size = new System.Drawing.Size(120, 36); 181 | this.btnHesapla.TabIndex = 9; 182 | this.btnHesapla.Text = "Hesapla"; 183 | this.btnHesapla.UseVisualStyleBackColor = true; 184 | this.btnHesapla.Click += new System.EventHandler(this.btnHesapla_Click); 185 | // 186 | // label6 187 | // 188 | this.label6.AutoSize = true; 189 | this.label6.Location = new System.Drawing.Point(41, 192); 190 | this.label6.Name = "label6"; 191 | this.label6.Size = new System.Drawing.Size(42, 13); 192 | this.label6.TabIndex = 15; 193 | this.label6.Text = "Toplam"; 194 | // 195 | // txtToplam 196 | // 197 | this.txtToplam.Enabled = false; 198 | this.txtToplam.Location = new System.Drawing.Point(110, 189); 199 | this.txtToplam.Name = "txtToplam"; 200 | this.txtToplam.Size = new System.Drawing.Size(96, 20); 201 | this.txtToplam.TabIndex = 14; 202 | // 203 | // label7 204 | // 205 | this.label7.AutoSize = true; 206 | this.label7.Location = new System.Drawing.Point(24, 76); 207 | this.label7.Name = "label7"; 208 | this.label7.Size = new System.Drawing.Size(42, 13); 209 | this.label7.TabIndex = 22; 210 | this.label7.Text = "Toplam"; 211 | // 212 | // txtT 213 | // 214 | this.txtT.Enabled = false; 215 | this.txtT.Location = new System.Drawing.Point(93, 73); 216 | this.txtT.Name = "txtT"; 217 | this.txtT.Size = new System.Drawing.Size(96, 20); 218 | this.txtT.TabIndex = 21; 219 | // 220 | // label8 221 | // 222 | this.label8.AutoSize = true; 223 | this.label8.Location = new System.Drawing.Point(24, 50); 224 | this.label8.Name = "label8"; 225 | this.label8.Size = new System.Drawing.Size(39, 13); 226 | this.label8.TabIndex = 20; 227 | this.label8.Text = "2. Sayı"; 228 | // 229 | // txtS2 230 | // 231 | this.txtS2.Location = new System.Drawing.Point(93, 47); 232 | this.txtS2.Name = "txtS2"; 233 | this.txtS2.Size = new System.Drawing.Size(96, 20); 234 | this.txtS2.TabIndex = 19; 235 | // 236 | // label9 237 | // 238 | this.label9.AutoSize = true; 239 | this.label9.Location = new System.Drawing.Point(24, 24); 240 | this.label9.Name = "label9"; 241 | this.label9.Size = new System.Drawing.Size(39, 13); 242 | this.label9.TabIndex = 18; 243 | this.label9.Text = "1. Sayı"; 244 | // 245 | // txtS1 246 | // 247 | this.txtS1.Location = new System.Drawing.Point(93, 21); 248 | this.txtS1.Name = "txtS1"; 249 | this.txtS1.Size = new System.Drawing.Size(96, 20); 250 | this.txtS1.TabIndex = 17; 251 | // 252 | // btnHesapla2 253 | // 254 | this.btnHesapla2.Location = new System.Drawing.Point(54, 146); 255 | this.btnHesapla2.Name = "btnHesapla2"; 256 | this.btnHesapla2.Size = new System.Drawing.Size(120, 36); 257 | this.btnHesapla2.TabIndex = 23; 258 | this.btnHesapla2.Text = "Hesapla"; 259 | this.btnHesapla2.UseVisualStyleBackColor = true; 260 | this.btnHesapla2.Click += new System.EventHandler(this.btnHesapla2_Click); 261 | // 262 | // rbTopla 263 | // 264 | this.rbTopla.AutoSize = true; 265 | this.rbTopla.Location = new System.Drawing.Point(45, 110); 266 | this.rbTopla.Name = "rbTopla"; 267 | this.rbTopla.Size = new System.Drawing.Size(31, 17); 268 | this.rbTopla.TabIndex = 24; 269 | this.rbTopla.TabStop = true; 270 | this.rbTopla.Text = "+"; 271 | this.rbTopla.UseVisualStyleBackColor = true; 272 | // 273 | // rbCikar 274 | // 275 | this.rbCikar.AutoSize = true; 276 | this.rbCikar.Location = new System.Drawing.Point(82, 110); 277 | this.rbCikar.Name = "rbCikar"; 278 | this.rbCikar.Size = new System.Drawing.Size(28, 17); 279 | this.rbCikar.TabIndex = 25; 280 | this.rbCikar.TabStop = true; 281 | this.rbCikar.Text = "-"; 282 | this.rbCikar.UseVisualStyleBackColor = true; 283 | // 284 | // rbCarp 285 | // 286 | this.rbCarp.AutoSize = true; 287 | this.rbCarp.Location = new System.Drawing.Point(117, 110); 288 | this.rbCarp.Name = "rbCarp"; 289 | this.rbCarp.Size = new System.Drawing.Size(29, 17); 290 | this.rbCarp.TabIndex = 26; 291 | this.rbCarp.TabStop = true; 292 | this.rbCarp.Text = "*"; 293 | this.rbCarp.UseVisualStyleBackColor = true; 294 | // 295 | // rbBol 296 | // 297 | this.rbBol.AutoSize = true; 298 | this.rbBol.Location = new System.Drawing.Point(152, 110); 299 | this.rbBol.Name = "rbBol"; 300 | this.rbBol.Size = new System.Drawing.Size(30, 17); 301 | this.rbBol.TabIndex = 27; 302 | this.rbBol.TabStop = true; 303 | this.rbBol.Text = "/"; 304 | this.rbBol.UseVisualStyleBackColor = true; 305 | // 306 | // radioButton5 307 | // 308 | this.radioButton5.AutoSize = true; 309 | this.radioButton5.Location = new System.Drawing.Point(15, 22); 310 | this.radioButton5.Name = "radioButton5"; 311 | this.radioButton5.Size = new System.Drawing.Size(52, 17); 312 | this.radioButton5.TabIndex = 28; 313 | this.radioButton5.TabStop = true; 314 | this.radioButton5.Text = "Kadın"; 315 | this.radioButton5.UseVisualStyleBackColor = true; 316 | // 317 | // radioButton6 318 | // 319 | this.radioButton6.AutoSize = true; 320 | this.radioButton6.Location = new System.Drawing.Point(15, 46); 321 | this.radioButton6.Name = "radioButton6"; 322 | this.radioButton6.Size = new System.Drawing.Size(53, 17); 323 | this.radioButton6.TabIndex = 29; 324 | this.radioButton6.TabStop = true; 325 | this.radioButton6.Text = "Erkek"; 326 | this.radioButton6.UseVisualStyleBackColor = true; 327 | // 328 | // groupBox1 329 | // 330 | this.groupBox1.Controls.Add(this.rbBol); 331 | this.groupBox1.Controls.Add(this.rbCarp); 332 | this.groupBox1.Controls.Add(this.rbCikar); 333 | this.groupBox1.Controls.Add(this.rbTopla); 334 | this.groupBox1.Controls.Add(this.btnHesapla2); 335 | this.groupBox1.Controls.Add(this.label7); 336 | this.groupBox1.Controls.Add(this.txtT); 337 | this.groupBox1.Controls.Add(this.label8); 338 | this.groupBox1.Controls.Add(this.txtS2); 339 | this.groupBox1.Controls.Add(this.label9); 340 | this.groupBox1.Controls.Add(this.txtS1); 341 | this.groupBox1.Location = new System.Drawing.Point(241, 137); 342 | this.groupBox1.Name = "groupBox1"; 343 | this.groupBox1.Size = new System.Drawing.Size(214, 211); 344 | this.groupBox1.TabIndex = 30; 345 | this.groupBox1.TabStop = false; 346 | this.groupBox1.Text = "Hesap Makinesi"; 347 | // 348 | // groupBox2 349 | // 350 | this.groupBox2.Controls.Add(this.radioButton6); 351 | this.groupBox2.Controls.Add(this.radioButton5); 352 | this.groupBox2.Location = new System.Drawing.Point(472, 140); 353 | this.groupBox2.Name = "groupBox2"; 354 | this.groupBox2.Size = new System.Drawing.Size(96, 77); 355 | this.groupBox2.TabIndex = 31; 356 | this.groupBox2.TabStop = false; 357 | this.groupBox2.Text = "Cinsiyet"; 358 | // 359 | // Form1 360 | // 361 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 362 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 363 | this.ClientSize = new System.Drawing.Size(800, 450); 364 | this.Controls.Add(this.groupBox2); 365 | this.Controls.Add(this.groupBox1); 366 | this.Controls.Add(this.label6); 367 | this.Controls.Add(this.txtToplam); 368 | this.Controls.Add(this.label4); 369 | this.Controls.Add(this.txtSayi2); 370 | this.Controls.Add(this.label5); 371 | this.Controls.Add(this.txtSayi1); 372 | this.Controls.Add(this.btnHesapla); 373 | this.Controls.Add(this.label3); 374 | this.Controls.Add(this.txtParola); 375 | this.Controls.Add(this.label2); 376 | this.Controls.Add(this.txtKullanici); 377 | this.Controls.Add(this.btnKontrol); 378 | this.Controls.Add(this.label1); 379 | this.Controls.Add(this.txtAdi); 380 | this.Controls.Add(this.btnGiris); 381 | this.Controls.Add(this.btnTikla); 382 | this.Name = "Form1"; 383 | this.Text = "Form1"; 384 | this.groupBox1.ResumeLayout(false); 385 | this.groupBox1.PerformLayout(); 386 | this.groupBox2.ResumeLayout(false); 387 | this.groupBox2.PerformLayout(); 388 | this.ResumeLayout(false); 389 | this.PerformLayout(); 390 | 391 | } 392 | 393 | #endregion 394 | 395 | private System.Windows.Forms.Button btnTikla; 396 | private System.Windows.Forms.Button btnGiris; 397 | private System.Windows.Forms.TextBox txtAdi; 398 | private System.Windows.Forms.Label label1; 399 | private System.Windows.Forms.Label label2; 400 | private System.Windows.Forms.TextBox txtKullanici; 401 | private System.Windows.Forms.Button btnKontrol; 402 | private System.Windows.Forms.Label label3; 403 | private System.Windows.Forms.TextBox txtParola; 404 | private System.Windows.Forms.Label label4; 405 | private System.Windows.Forms.TextBox txtSayi2; 406 | private System.Windows.Forms.Label label5; 407 | private System.Windows.Forms.TextBox txtSayi1; 408 | private System.Windows.Forms.Button btnHesapla; 409 | private System.Windows.Forms.Label label6; 410 | private System.Windows.Forms.TextBox txtToplam; 411 | private System.Windows.Forms.Label label7; 412 | private System.Windows.Forms.TextBox txtT; 413 | private System.Windows.Forms.Label label8; 414 | private System.Windows.Forms.TextBox txtS2; 415 | private System.Windows.Forms.Label label9; 416 | private System.Windows.Forms.TextBox txtS1; 417 | private System.Windows.Forms.Button btnHesapla2; 418 | private System.Windows.Forms.RadioButton rbTopla; 419 | private System.Windows.Forms.RadioButton rbCikar; 420 | private System.Windows.Forms.RadioButton rbCarp; 421 | private System.Windows.Forms.RadioButton rbBol; 422 | private System.Windows.Forms.RadioButton radioButton5; 423 | private System.Windows.Forms.RadioButton radioButton6; 424 | private System.Windows.Forms.GroupBox groupBox1; 425 | private System.Windows.Forms.GroupBox groupBox2; 426 | } 427 | } 428 | 429 | -------------------------------------------------------------------------------- /PythonKernel_IlkOrnek-checkpoint.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 | "Merhaba\n" 13 | ] 14 | } 15 | ], 16 | "source": [ 17 | "print(\"Merhaba\")" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 2, 23 | "metadata": {}, 24 | "outputs": [ 25 | { 26 | "data": { 27 | "text/plain": [ 28 | "10" 29 | ] 30 | }, 31 | "execution_count": 2, 32 | "metadata": {}, 33 | "output_type": "execute_result" 34 | } 35 | ], 36 | "source": [ 37 | "sayı=10\n", 38 | "sayı" 39 | ] 40 | }, 41 | { 42 | "cell_type": "markdown", 43 | "metadata": {}, 44 | "source": [ 45 | "Bu bir açıklama satırıdır" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 3, 51 | "metadata": {}, 52 | "outputs": [ 53 | { 54 | "data": { 55 | "text/plain": [ 56 | "'\\nBu bir açıklama bloğudur\\n'" 57 | ] 58 | }, 59 | "execution_count": 3, 60 | "metadata": {}, 61 | "output_type": "execute_result" 62 | } 63 | ], 64 | "source": [ 65 | "#Bu açıklama satırıdır\n", 66 | "\"\"\"\n", 67 | "Bu bir açıklama bloğudur\n", 68 | "\"\"\"" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 4, 74 | "metadata": {}, 75 | "outputs": [ 76 | { 77 | "name": "stdout", 78 | "output_type": "stream", 79 | "text": [ 80 | "Merhaba\n" 81 | ] 82 | } 83 | ], 84 | "source": [ 85 | "print(\"\"\"Merhaba\"\"\")" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": 6, 91 | "metadata": {}, 92 | "outputs": [ 93 | { 94 | "name": "stdout", 95 | "output_type": "stream", 96 | "text": [ 97 | "10\n" 98 | ] 99 | } 100 | ], 101 | "source": [ 102 | "if(sayı==10):\n", 103 | " print(sayı)" 104 | ] 105 | }, 106 | { 107 | "cell_type": "code", 108 | "execution_count": 8, 109 | "metadata": {}, 110 | "outputs": [ 111 | { 112 | "name": "stdout", 113 | "output_type": "stream", 114 | "text": [ 115 | "10\n" 116 | ] 117 | } 118 | ], 119 | "source": [ 120 | "print(sayı)" 121 | ] 122 | }, 123 | { 124 | "cell_type": "code", 125 | "execution_count": 10, 126 | "metadata": {}, 127 | "outputs": [ 128 | { 129 | "name": "stdout", 130 | "output_type": "stream", 131 | "text": [ 132 | "Hoca'nın alerjisi var\n" 133 | ] 134 | } 135 | ], 136 | "source": [ 137 | "print('Hoca\\'nın alerjisi var')" 138 | ] 139 | }, 140 | { 141 | "cell_type": "code", 142 | "execution_count": 11, 143 | "metadata": {}, 144 | "outputs": [ 145 | { 146 | "data": { 147 | "text/plain": [ 148 | "8.0" 149 | ] 150 | }, 151 | "execution_count": 11, 152 | "metadata": {}, 153 | "output_type": "execute_result" 154 | } 155 | ], 156 | "source": [ 157 | "56/7" 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": 12, 163 | "metadata": {}, 164 | "outputs": [ 165 | { 166 | "name": "stdout", 167 | "output_type": "stream", 168 | "text": [ 169 | "8.0\n" 170 | ] 171 | } 172 | ], 173 | "source": [ 174 | "print(56/7)" 175 | ] 176 | }, 177 | { 178 | "cell_type": "code", 179 | "execution_count": 14, 180 | "metadata": {}, 181 | "outputs": [ 182 | { 183 | "data": { 184 | "text/plain": [ 185 | "17.0" 186 | ] 187 | }, 188 | "execution_count": 14, 189 | "metadata": {}, 190 | "output_type": "execute_result" 191 | } 192 | ], 193 | "source": [ 194 | "5+12*2/3+4" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": 15, 200 | "metadata": {}, 201 | "outputs": [ 202 | { 203 | "data": { 204 | "text/plain": [ 205 | "15.333333333333334" 206 | ] 207 | }, 208 | "execution_count": 15, 209 | "metadata": {}, 210 | "output_type": "execute_result" 211 | } 212 | ], 213 | "source": [ 214 | "(5+12)*2/3+4" 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 19, 220 | "metadata": {}, 221 | "outputs": [ 222 | { 223 | "data": { 224 | "text/plain": [ 225 | "(4, 5)" 226 | ] 227 | }, 228 | "execution_count": 19, 229 | "metadata": {}, 230 | "output_type": "execute_result" 231 | } 232 | ], 233 | "source": [ 234 | "a=5\n", 235 | "b=4\n", 236 | "x=a\n", 237 | "a=b\n", 238 | "b=x\n", 239 | "a,b" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": 20, 245 | "metadata": {}, 246 | "outputs": [ 247 | { 248 | "data": { 249 | "text/plain": [ 250 | "(5, 4)" 251 | ] 252 | }, 253 | "execution_count": 20, 254 | "metadata": {}, 255 | "output_type": "execute_result" 256 | } 257 | ], 258 | "source": [ 259 | "a,b=b,a\n", 260 | "a,b" 261 | ] 262 | }, 263 | { 264 | "cell_type": "code", 265 | "execution_count": 33, 266 | "metadata": {}, 267 | "outputs": [ 268 | { 269 | "data": { 270 | "text/plain": [ 271 | "(2, 3, 4)" 272 | ] 273 | }, 274 | "execution_count": 33, 275 | "metadata": {}, 276 | "output_type": "execute_result" 277 | } 278 | ], 279 | "source": [ 280 | "a,b,c=2,3,4\n", 281 | "a,b,c" 282 | ] 283 | }, 284 | { 285 | "cell_type": "code", 286 | "execution_count": 34, 287 | "metadata": {}, 288 | "outputs": [ 289 | { 290 | "data": { 291 | "text/plain": [ 292 | "3" 293 | ] 294 | }, 295 | "execution_count": 34, 296 | "metadata": {}, 297 | "output_type": "execute_result" 298 | } 299 | ], 300 | "source": [ 301 | "a+=1\n", 302 | "a" 303 | ] 304 | }, 305 | { 306 | "cell_type": "code", 307 | "execution_count": 35, 308 | "metadata": {}, 309 | "outputs": [ 310 | { 311 | "data": { 312 | "text/plain": [ 313 | "8" 314 | ] 315 | }, 316 | "execution_count": 35, 317 | "metadata": {}, 318 | "output_type": "execute_result" 319 | } 320 | ], 321 | "source": [ 322 | "a=a+5\n", 323 | "a" 324 | ] 325 | }, 326 | { 327 | "cell_type": "code", 328 | "execution_count": 36, 329 | "metadata": {}, 330 | "outputs": [ 331 | { 332 | "data": { 333 | "text/plain": [ 334 | "16" 335 | ] 336 | }, 337 | "execution_count": 36, 338 | "metadata": {}, 339 | "output_type": "execute_result" 340 | } 341 | ], 342 | "source": [ 343 | "a*=2 #a=a*2\n", 344 | "a" 345 | ] 346 | }, 347 | { 348 | "cell_type": "code", 349 | "execution_count": 38, 350 | "metadata": {}, 351 | "outputs": [ 352 | { 353 | "data": { 354 | "text/plain": [ 355 | "5.333333333333333" 356 | ] 357 | }, 358 | "execution_count": 38, 359 | "metadata": {}, 360 | "output_type": "execute_result" 361 | } 362 | ], 363 | "source": [ 364 | "16/3" 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": 39, 370 | "metadata": {}, 371 | "outputs": [ 372 | { 373 | "data": { 374 | "text/plain": [ 375 | "5" 376 | ] 377 | }, 378 | "execution_count": 39, 379 | "metadata": {}, 380 | "output_type": "execute_result" 381 | } 382 | ], 383 | "source": [ 384 | "16//3" 385 | ] 386 | }, 387 | { 388 | "cell_type": "code", 389 | "execution_count": 40, 390 | "metadata": {}, 391 | "outputs": [ 392 | { 393 | "data": { 394 | "text/plain": [ 395 | "1.5" 396 | ] 397 | }, 398 | "execution_count": 40, 399 | "metadata": {}, 400 | "output_type": "execute_result" 401 | } 402 | ], 403 | "source": [ 404 | "3/2" 405 | ] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "execution_count": 41, 410 | "metadata": {}, 411 | "outputs": [ 412 | { 413 | "data": { 414 | "text/plain": [ 415 | "1" 416 | ] 417 | }, 418 | "execution_count": 41, 419 | "metadata": {}, 420 | "output_type": "execute_result" 421 | } 422 | ], 423 | "source": [ 424 | "3//2" 425 | ] 426 | }, 427 | { 428 | "cell_type": "code", 429 | "execution_count": 42, 430 | "metadata": {}, 431 | "outputs": [ 432 | { 433 | "data": { 434 | "text/plain": [ 435 | "1" 436 | ] 437 | }, 438 | "execution_count": 42, 439 | "metadata": {}, 440 | "output_type": "execute_result" 441 | } 442 | ], 443 | "source": [ 444 | "int(3/2)" 445 | ] 446 | }, 447 | { 448 | "cell_type": "code", 449 | "execution_count": 43, 450 | "metadata": {}, 451 | "outputs": [ 452 | { 453 | "data": { 454 | "text/plain": [ 455 | "2" 456 | ] 457 | }, 458 | "execution_count": 43, 459 | "metadata": {}, 460 | "output_type": "execute_result" 461 | } 462 | ], 463 | "source": [ 464 | "round(3/2)" 465 | ] 466 | }, 467 | { 468 | "cell_type": "code", 469 | "execution_count": 44, 470 | "metadata": {}, 471 | "outputs": [ 472 | { 473 | "data": { 474 | "text/plain": [ 475 | "1" 476 | ] 477 | }, 478 | "execution_count": 44, 479 | "metadata": {}, 480 | "output_type": "execute_result" 481 | } 482 | ], 483 | "source": [ 484 | "round(4/3)" 485 | ] 486 | }, 487 | { 488 | "cell_type": "code", 489 | "execution_count": 45, 490 | "metadata": {}, 491 | "outputs": [ 492 | { 493 | "data": { 494 | "text/plain": [ 495 | "1.3333333333333333" 496 | ] 497 | }, 498 | "execution_count": 45, 499 | "metadata": {}, 500 | "output_type": "execute_result" 501 | } 502 | ], 503 | "source": [ 504 | "4/3" 505 | ] 506 | }, 507 | { 508 | "cell_type": "code", 509 | "execution_count": 46, 510 | "metadata": {}, 511 | "outputs": [ 512 | { 513 | "data": { 514 | "text/plain": [ 515 | "1" 516 | ] 517 | }, 518 | "execution_count": 46, 519 | "metadata": {}, 520 | "output_type": "execute_result" 521 | } 522 | ], 523 | "source": [ 524 | "4%3" 525 | ] 526 | }, 527 | { 528 | "cell_type": "code", 529 | "execution_count": 47, 530 | "metadata": {}, 531 | "outputs": [ 532 | { 533 | "data": { 534 | "text/plain": [ 535 | "1" 536 | ] 537 | }, 538 | "execution_count": 47, 539 | "metadata": {}, 540 | "output_type": "execute_result" 541 | } 542 | ], 543 | "source": [ 544 | "15%2" 545 | ] 546 | }, 547 | { 548 | "cell_type": "code", 549 | "execution_count": 48, 550 | "metadata": {}, 551 | "outputs": [ 552 | { 553 | "data": { 554 | "text/plain": [ 555 | "8" 556 | ] 557 | }, 558 | "execution_count": 48, 559 | "metadata": {}, 560 | "output_type": "execute_result" 561 | } 562 | ], 563 | "source": [ 564 | "2**3" 565 | ] 566 | }, 567 | { 568 | "cell_type": "code", 569 | "execution_count": 49, 570 | "metadata": {}, 571 | "outputs": [ 572 | { 573 | "data": { 574 | "text/plain": [ 575 | "1024" 576 | ] 577 | }, 578 | "execution_count": 49, 579 | "metadata": {}, 580 | "output_type": "execute_result" 581 | } 582 | ], 583 | "source": [ 584 | "4**5" 585 | ] 586 | }, 587 | { 588 | "cell_type": "code", 589 | "execution_count": 50, 590 | "metadata": {}, 591 | "outputs": [ 592 | { 593 | "data": { 594 | "text/plain": [ 595 | "4.0" 596 | ] 597 | }, 598 | "execution_count": 50, 599 | "metadata": {}, 600 | "output_type": "execute_result" 601 | } 602 | ], 603 | "source": [ 604 | "16**(1/2)" 605 | ] 606 | }, 607 | { 608 | "cell_type": "code", 609 | "execution_count": 51, 610 | "metadata": {}, 611 | "outputs": [ 612 | { 613 | "data": { 614 | "text/plain": [ 615 | "4.0" 616 | ] 617 | }, 618 | "execution_count": 51, 619 | "metadata": {}, 620 | "output_type": "execute_result" 621 | } 622 | ], 623 | "source": [ 624 | "16**0.5" 625 | ] 626 | }, 627 | { 628 | "cell_type": "code", 629 | "execution_count": 52, 630 | "metadata": {}, 631 | "outputs": [ 632 | { 633 | "data": { 634 | "text/plain": [ 635 | "2.0" 636 | ] 637 | }, 638 | "execution_count": 52, 639 | "metadata": {}, 640 | "output_type": "execute_result" 641 | } 642 | ], 643 | "source": [ 644 | "8**(1/3)" 645 | ] 646 | }, 647 | { 648 | "cell_type": "code", 649 | "execution_count": 53, 650 | "metadata": {}, 651 | "outputs": [ 652 | { 653 | "data": { 654 | "text/plain": [ 655 | "56.666666666666664" 656 | ] 657 | }, 658 | "execution_count": 53, 659 | "metadata": {}, 660 | "output_type": "execute_result" 661 | } 662 | ], 663 | "source": [ 664 | "85*(2/3)" 665 | ] 666 | }, 667 | { 668 | "cell_type": "code", 669 | "execution_count": 54, 670 | "metadata": {}, 671 | "outputs": [], 672 | "source": [ 673 | "a=5" 674 | ] 675 | }, 676 | { 677 | "cell_type": "code", 678 | "execution_count": 55, 679 | "metadata": {}, 680 | "outputs": [ 681 | { 682 | "data": { 683 | "text/plain": [ 684 | "-5" 685 | ] 686 | }, 687 | "execution_count": 55, 688 | "metadata": {}, 689 | "output_type": "execute_result" 690 | } 691 | ], 692 | "source": [ 693 | "-a" 694 | ] 695 | }, 696 | { 697 | "cell_type": "code", 698 | "execution_count": 56, 699 | "metadata": {}, 700 | "outputs": [ 701 | { 702 | "data": { 703 | "text/plain": [ 704 | "5" 705 | ] 706 | }, 707 | "execution_count": 56, 708 | "metadata": {}, 709 | "output_type": "execute_result" 710 | } 711 | ], 712 | "source": [ 713 | "a" 714 | ] 715 | }, 716 | { 717 | "cell_type": "code", 718 | "execution_count": 57, 719 | "metadata": {}, 720 | "outputs": [], 721 | "source": [ 722 | "a=-a" 723 | ] 724 | }, 725 | { 726 | "cell_type": "code", 727 | "execution_count": 58, 728 | "metadata": {}, 729 | "outputs": [ 730 | { 731 | "data": { 732 | "text/plain": [ 733 | "-5" 734 | ] 735 | }, 736 | "execution_count": 58, 737 | "metadata": {}, 738 | "output_type": "execute_result" 739 | } 740 | ], 741 | "source": [ 742 | "a" 743 | ] 744 | }, 745 | { 746 | "cell_type": "code", 747 | "execution_count": 62, 748 | "metadata": {}, 749 | "outputs": [ 750 | { 751 | "name": "stdout", 752 | "output_type": "stream", 753 | "text": [ 754 | "Sayı:10\n" 755 | ] 756 | } 757 | ], 758 | "source": [ 759 | "a=int(input(\"Sayı:\"))" 760 | ] 761 | }, 762 | { 763 | "cell_type": "code", 764 | "execution_count": 63, 765 | "metadata": {}, 766 | "outputs": [], 767 | "source": [ 768 | "a=-a" 769 | ] 770 | }, 771 | { 772 | "cell_type": "code", 773 | "execution_count": 64, 774 | "metadata": {}, 775 | "outputs": [ 776 | { 777 | "data": { 778 | "text/plain": [ 779 | "-10" 780 | ] 781 | }, 782 | "execution_count": 64, 783 | "metadata": {}, 784 | "output_type": "execute_result" 785 | } 786 | ], 787 | "source": [ 788 | "a" 789 | ] 790 | }, 791 | { 792 | "cell_type": "code", 793 | "execution_count": 66, 794 | "metadata": { 795 | "scrolled": true 796 | }, 797 | "outputs": [ 798 | { 799 | "data": { 800 | "text/plain": [ 801 | "'Beykoz Üniversitesi'" 802 | ] 803 | }, 804 | "execution_count": 66, 805 | "metadata": {}, 806 | "output_type": "execute_result" 807 | } 808 | ], 809 | "source": [ 810 | "a=\"Beykoz Üniversitesi\"\n", 811 | "a" 812 | ] 813 | }, 814 | { 815 | "cell_type": "code", 816 | "execution_count": 67, 817 | "metadata": {}, 818 | "outputs": [ 819 | { 820 | "name": "stdout", 821 | "output_type": "stream", 822 | "text": [ 823 | "Beykoz Üniversitesi\n" 824 | ] 825 | } 826 | ], 827 | "source": [ 828 | "print(a)" 829 | ] 830 | }, 831 | { 832 | "cell_type": "code", 833 | "execution_count": 68, 834 | "metadata": {}, 835 | "outputs": [ 836 | { 837 | "data": { 838 | "text/plain": [ 839 | "'Ü'" 840 | ] 841 | }, 842 | "execution_count": 68, 843 | "metadata": {}, 844 | "output_type": "execute_result" 845 | } 846 | ], 847 | "source": [ 848 | "a[7]" 849 | ] 850 | }, 851 | { 852 | "cell_type": "code", 853 | "execution_count": 78, 854 | "metadata": {}, 855 | "outputs": [ 856 | { 857 | "data": { 858 | "text/plain": [ 859 | "'Beykoz '" 860 | ] 861 | }, 862 | "execution_count": 78, 863 | "metadata": {}, 864 | "output_type": "execute_result" 865 | } 866 | ], 867 | "source": [ 868 | "a[:7]" 869 | ] 870 | }, 871 | { 872 | "cell_type": "code", 873 | "execution_count": 79, 874 | "metadata": {}, 875 | "outputs": [ 876 | { 877 | "data": { 878 | "text/plain": [ 879 | "'koz'" 880 | ] 881 | }, 882 | "execution_count": 79, 883 | "metadata": {}, 884 | "output_type": "execute_result" 885 | } 886 | ], 887 | "source": [ 888 | "a[3:6]" 889 | ] 890 | }, 891 | { 892 | "cell_type": "code", 893 | "execution_count": 80, 894 | "metadata": {}, 895 | "outputs": [ 896 | { 897 | "data": { 898 | "text/plain": [ 899 | "'Beykoz Üniversitesi'" 900 | ] 901 | }, 902 | "execution_count": 80, 903 | "metadata": {}, 904 | "output_type": "execute_result" 905 | } 906 | ], 907 | "source": [ 908 | "a" 909 | ] 910 | }, 911 | { 912 | "cell_type": "code", 913 | "execution_count": 81, 914 | "metadata": {}, 915 | "outputs": [ 916 | { 917 | "data": { 918 | "text/plain": [ 919 | "'Üniv'" 920 | ] 921 | }, 922 | "execution_count": 81, 923 | "metadata": {}, 924 | "output_type": "execute_result" 925 | } 926 | ], 927 | "source": [ 928 | "a[7:11] #Üniv değerini alır. " 929 | ] 930 | }, 931 | { 932 | "cell_type": "code", 933 | "execution_count": 82, 934 | "metadata": {}, 935 | "outputs": [ 936 | { 937 | "data": { 938 | "text/plain": [ 939 | "'Beykoz Üniversitesi'" 940 | ] 941 | }, 942 | "execution_count": 82, 943 | "metadata": {}, 944 | "output_type": "execute_result" 945 | } 946 | ], 947 | "source": [ 948 | "a[::]" 949 | ] 950 | }, 951 | { 952 | "cell_type": "code", 953 | "execution_count": 83, 954 | "metadata": {}, 955 | "outputs": [ 956 | { 957 | "data": { 958 | "text/plain": [ 959 | "'Üniversitesi'" 960 | ] 961 | }, 962 | "execution_count": 83, 963 | "metadata": {}, 964 | "output_type": "execute_result" 965 | } 966 | ], 967 | "source": [ 968 | "a[7:]" 969 | ] 970 | }, 971 | { 972 | "cell_type": "code", 973 | "execution_count": 84, 974 | "metadata": {}, 975 | "outputs": [ 976 | { 977 | "data": { 978 | "text/plain": [ 979 | "'Üiests'" 980 | ] 981 | }, 982 | "execution_count": 84, 983 | "metadata": {}, 984 | "output_type": "execute_result" 985 | } 986 | ], 987 | "source": [ 988 | "a[7::2]" 989 | ] 990 | }, 991 | { 992 | "cell_type": "code", 993 | "execution_count": 85, 994 | "metadata": {}, 995 | "outputs": [ 996 | { 997 | "data": { 998 | "text/plain": [ 999 | "'Üvse'" 1000 | ] 1001 | }, 1002 | "execution_count": 85, 1003 | "metadata": {}, 1004 | "output_type": "execute_result" 1005 | } 1006 | ], 1007 | "source": [ 1008 | "a[7::3]" 1009 | ] 1010 | }, 1011 | { 1012 | "cell_type": "code", 1013 | "execution_count": 86, 1014 | "metadata": {}, 1015 | "outputs": [ 1016 | { 1017 | "data": { 1018 | "text/plain": [ 1019 | "'isetisrevinÜ zokyeB'" 1020 | ] 1021 | }, 1022 | "execution_count": 86, 1023 | "metadata": {}, 1024 | "output_type": "execute_result" 1025 | } 1026 | ], 1027 | "source": [ 1028 | "a[::-1]" 1029 | ] 1030 | }, 1031 | { 1032 | "cell_type": "code", 1033 | "execution_count": 87, 1034 | "metadata": {}, 1035 | "outputs": [ 1036 | { 1037 | "data": { 1038 | "text/plain": [ 1039 | "'Beykoz Üniversitesi'" 1040 | ] 1041 | }, 1042 | "execution_count": 87, 1043 | "metadata": {}, 1044 | "output_type": "execute_result" 1045 | } 1046 | ], 1047 | "source": [ 1048 | "a" 1049 | ] 1050 | }, 1051 | { 1052 | "cell_type": "code", 1053 | "execution_count": 93, 1054 | "metadata": {}, 1055 | "outputs": [ 1056 | { 1057 | "data": { 1058 | "text/plain": [ 1059 | "'eti'" 1060 | ] 1061 | }, 1062 | "execution_count": 93, 1063 | "metadata": {}, 1064 | "output_type": "execute_result" 1065 | } 1066 | ], 1067 | "source": [ 1068 | "a[-3:-6:-1]" 1069 | ] 1070 | }, 1071 | { 1072 | "cell_type": "code", 1073 | "execution_count": 94, 1074 | "metadata": {}, 1075 | "outputs": [ 1076 | { 1077 | "data": { 1078 | "text/plain": [ 1079 | "'tis'" 1080 | ] 1081 | }, 1082 | "execution_count": 94, 1083 | "metadata": {}, 1084 | "output_type": "execute_result" 1085 | } 1086 | ], 1087 | "source": [ 1088 | "a[-4:-7:-1]" 1089 | ] 1090 | }, 1091 | { 1092 | "cell_type": "code", 1093 | "execution_count": 95, 1094 | "metadata": {}, 1095 | "outputs": [ 1096 | { 1097 | "data": { 1098 | "text/plain": [ 1099 | "'i'" 1100 | ] 1101 | }, 1102 | "execution_count": 95, 1103 | "metadata": {}, 1104 | "output_type": "execute_result" 1105 | } 1106 | ], 1107 | "source": [ 1108 | "a[-1]" 1109 | ] 1110 | }, 1111 | { 1112 | "cell_type": "code", 1113 | "execution_count": 96, 1114 | "metadata": {}, 1115 | "outputs": [ 1116 | { 1117 | "data": { 1118 | "text/plain": [ 1119 | "'Beykoz Üniversitesi'" 1120 | ] 1121 | }, 1122 | "execution_count": 96, 1123 | "metadata": {}, 1124 | "output_type": "execute_result" 1125 | } 1126 | ], 1127 | "source": [ 1128 | "a" 1129 | ] 1130 | }, 1131 | { 1132 | "cell_type": "code", 1133 | "execution_count": 97, 1134 | "metadata": {}, 1135 | "outputs": [ 1136 | { 1137 | "data": { 1138 | "text/plain": [ 1139 | "19" 1140 | ] 1141 | }, 1142 | "execution_count": 97, 1143 | "metadata": {}, 1144 | "output_type": "execute_result" 1145 | } 1146 | ], 1147 | "source": [ 1148 | "len(a)" 1149 | ] 1150 | }, 1151 | { 1152 | "cell_type": "code", 1153 | "execution_count": 98, 1154 | "metadata": {}, 1155 | "outputs": [], 1156 | "source": [ 1157 | "a=\"1234432\"" 1158 | ] 1159 | }, 1160 | { 1161 | "cell_type": "code", 1162 | "execution_count": 99, 1163 | "metadata": {}, 1164 | "outputs": [ 1165 | { 1166 | "data": { 1167 | "text/plain": [ 1168 | "7" 1169 | ] 1170 | }, 1171 | "execution_count": 99, 1172 | "metadata": {}, 1173 | "output_type": "execute_result" 1174 | } 1175 | ], 1176 | "source": [ 1177 | "len(a)" 1178 | ] 1179 | }, 1180 | { 1181 | "cell_type": "code", 1182 | "execution_count": 101, 1183 | "metadata": {}, 1184 | "outputs": [ 1185 | { 1186 | "data": { 1187 | "text/plain": [ 1188 | "('12233', 5)" 1189 | ] 1190 | }, 1191 | "execution_count": 101, 1192 | "metadata": {}, 1193 | "output_type": "execute_result" 1194 | } 1195 | ], 1196 | "source": [ 1197 | "a=12233\n", 1198 | "a=str(a)\n", 1199 | "a,len(a)" 1200 | ] 1201 | }, 1202 | { 1203 | "cell_type": "code", 1204 | "execution_count": 102, 1205 | "metadata": {}, 1206 | "outputs": [ 1207 | { 1208 | "data": { 1209 | "text/plain": [ 1210 | "str" 1211 | ] 1212 | }, 1213 | "execution_count": 102, 1214 | "metadata": {}, 1215 | "output_type": "execute_result" 1216 | } 1217 | ], 1218 | "source": [ 1219 | "type(a)" 1220 | ] 1221 | }, 1222 | { 1223 | "cell_type": "code", 1224 | "execution_count": 103, 1225 | "metadata": {}, 1226 | "outputs": [ 1227 | { 1228 | "data": { 1229 | "text/plain": [ 1230 | "int" 1231 | ] 1232 | }, 1233 | "execution_count": 103, 1234 | "metadata": {}, 1235 | "output_type": "execute_result" 1236 | } 1237 | ], 1238 | "source": [ 1239 | "a=123\n", 1240 | "type(a)" 1241 | ] 1242 | }, 1243 | { 1244 | "cell_type": "code", 1245 | "execution_count": 104, 1246 | "metadata": {}, 1247 | "outputs": [ 1248 | { 1249 | "data": { 1250 | "text/plain": [ 1251 | "float" 1252 | ] 1253 | }, 1254 | "execution_count": 104, 1255 | "metadata": {}, 1256 | "output_type": "execute_result" 1257 | } 1258 | ], 1259 | "source": [ 1260 | "a=1.3\n", 1261 | "type(a)" 1262 | ] 1263 | }, 1264 | { 1265 | "cell_type": "code", 1266 | "execution_count": 105, 1267 | "metadata": {}, 1268 | "outputs": [ 1269 | { 1270 | "data": { 1271 | "text/plain": [ 1272 | "bool" 1273 | ] 1274 | }, 1275 | "execution_count": 105, 1276 | "metadata": {}, 1277 | "output_type": "execute_result" 1278 | } 1279 | ], 1280 | "source": [ 1281 | "a=True\n", 1282 | "type(a)" 1283 | ] 1284 | }, 1285 | { 1286 | "cell_type": "code", 1287 | "execution_count": 108, 1288 | "metadata": {}, 1289 | "outputs": [], 1290 | "source": [ 1291 | "a=\"a\"" 1292 | ] 1293 | }, 1294 | { 1295 | "cell_type": "code", 1296 | "execution_count": 109, 1297 | "metadata": {}, 1298 | "outputs": [ 1299 | { 1300 | "data": { 1301 | "text/plain": [ 1302 | "str" 1303 | ] 1304 | }, 1305 | "execution_count": 109, 1306 | "metadata": {}, 1307 | "output_type": "execute_result" 1308 | } 1309 | ], 1310 | "source": [ 1311 | "type(a)" 1312 | ] 1313 | }, 1314 | { 1315 | "cell_type": "code", 1316 | "execution_count": 110, 1317 | "metadata": {}, 1318 | "outputs": [ 1319 | { 1320 | "data": { 1321 | "text/plain": [ 1322 | "'ABC'" 1323 | ] 1324 | }, 1325 | "execution_count": 110, 1326 | "metadata": {}, 1327 | "output_type": "execute_result" 1328 | } 1329 | ], 1330 | "source": [ 1331 | "a=\"A\"\n", 1332 | "b=\"B\"\n", 1333 | "c=\"C\"\n", 1334 | "a+b+c" 1335 | ] 1336 | }, 1337 | { 1338 | "cell_type": "code", 1339 | "execution_count": 112, 1340 | "metadata": {}, 1341 | "outputs": [ 1342 | { 1343 | "name": "stdout", 1344 | "output_type": "stream", 1345 | "text": [ 1346 | "A B C" 1347 | ] 1348 | } 1349 | ], 1350 | "source": [ 1351 | "print(a,b,c,end=\"\")" 1352 | ] 1353 | }, 1354 | { 1355 | "cell_type": "code", 1356 | "execution_count": 113, 1357 | "metadata": {}, 1358 | "outputs": [ 1359 | { 1360 | "data": { 1361 | "text/plain": [ 1362 | "'A B C'" 1363 | ] 1364 | }, 1365 | "execution_count": 113, 1366 | "metadata": {}, 1367 | "output_type": "execute_result" 1368 | } 1369 | ], 1370 | "source": [ 1371 | "a+\" \"+b+\" \"+c" 1372 | ] 1373 | }, 1374 | { 1375 | "cell_type": "code", 1376 | "execution_count": 114, 1377 | "metadata": {}, 1378 | "outputs": [ 1379 | { 1380 | "name": "stdout", 1381 | "output_type": "stream", 1382 | "text": [ 1383 | "A.B.C\n" 1384 | ] 1385 | } 1386 | ], 1387 | "source": [ 1388 | "print(a,b,c,sep=\".\")" 1389 | ] 1390 | }, 1391 | { 1392 | "cell_type": "code", 1393 | "execution_count": 115, 1394 | "metadata": {}, 1395 | "outputs": [ 1396 | { 1397 | "name": "stdout", 1398 | "output_type": "stream", 1399 | "text": [ 1400 | "21/2/2019\n" 1401 | ] 1402 | } 1403 | ], 1404 | "source": [ 1405 | "print(21,2,2019,sep=\"/\")" 1406 | ] 1407 | }, 1408 | { 1409 | "cell_type": "code", 1410 | "execution_count": 118, 1411 | "metadata": {}, 1412 | "outputs": [ 1413 | { 1414 | "name": "stdout", 1415 | "output_type": "stream", 1416 | "text": [ 1417 | "21 Ocak 2019\n" 1418 | ] 1419 | } 1420 | ], 1421 | "source": [ 1422 | "print(\"21\",\"Ocak\",\"2019\",sep=\" \")" 1423 | ] 1424 | }, 1425 | { 1426 | "cell_type": "code", 1427 | "execution_count": 119, 1428 | "metadata": {}, 1429 | "outputs": [ 1430 | { 1431 | "name": "stdout", 1432 | "output_type": "stream", 1433 | "text": [ 1434 | "A\n", 1435 | "B\n", 1436 | "C\n" 1437 | ] 1438 | } 1439 | ], 1440 | "source": [ 1441 | "print(a,b,c,sep=\"\\n\")" 1442 | ] 1443 | }, 1444 | { 1445 | "cell_type": "code", 1446 | "execution_count": 120, 1447 | "metadata": {}, 1448 | "outputs": [ 1449 | { 1450 | "name": "stdout", 1451 | "output_type": "stream", 1452 | "text": [ 1453 | "A\tB\tC\n" 1454 | ] 1455 | } 1456 | ], 1457 | "source": [ 1458 | "print(a,b,c,sep=\"\\t\")" 1459 | ] 1460 | }, 1461 | { 1462 | "cell_type": "code", 1463 | "execution_count": 129, 1464 | "metadata": {}, 1465 | "outputs": [ 1466 | { 1467 | "name": "stdout", 1468 | "output_type": "stream", 1469 | "text": [ 1470 | "3.567 \t 7.57 \n", 1471 | "\n", 1472 | "3.5 \t 787.57 \n", 1473 | "\n" 1474 | ] 1475 | } 1476 | ], 1477 | "source": [ 1478 | "print(3.567,\"\\t\",\"{:10.2f}\".format(7.567),\"\\n\")\n", 1479 | "print(3.5,\"\\t\",\"{:10.2f}\".format(787.567),\"\\n\")" 1480 | ] 1481 | }, 1482 | { 1483 | "cell_type": "code", 1484 | "execution_count": 130, 1485 | "metadata": {}, 1486 | "outputs": [], 1487 | "source": [ 1488 | "a=6.456" 1489 | ] 1490 | }, 1491 | { 1492 | "cell_type": "code", 1493 | "execution_count": 131, 1494 | "metadata": {}, 1495 | "outputs": [], 1496 | "source": [ 1497 | "b=456.5634" 1498 | ] 1499 | }, 1500 | { 1501 | "cell_type": "code", 1502 | "execution_count": 134, 1503 | "metadata": {}, 1504 | "outputs": [ 1505 | { 1506 | "name": "stdout", 1507 | "output_type": "stream", 1508 | "text": [ 1509 | " 6.46\n", 1510 | " 456.56\n" 1511 | ] 1512 | } 1513 | ], 1514 | "source": [ 1515 | "print(\"{:15.2f}\".format(a))\n", 1516 | "print(\"{:15.2f}\".format(b))" 1517 | ] 1518 | }, 1519 | { 1520 | "cell_type": "code", 1521 | "execution_count": 136, 1522 | "metadata": {}, 1523 | "outputs": [ 1524 | { 1525 | "name": "stdout", 1526 | "output_type": "stream", 1527 | "text": [ 1528 | "6.456 456.5634\n" 1529 | ] 1530 | } 1531 | ], 1532 | "source": [ 1533 | "print(\"{} {}\".format(a,b))" 1534 | ] 1535 | }, 1536 | { 1537 | "cell_type": "code", 1538 | "execution_count": 137, 1539 | "metadata": {}, 1540 | "outputs": [ 1541 | { 1542 | "name": "stdout", 1543 | "output_type": "stream", 1544 | "text": [ 1545 | "456.5634 6.456\n" 1546 | ] 1547 | } 1548 | ], 1549 | "source": [ 1550 | "print(\"{1} {0}\".format(a,b))" 1551 | ] 1552 | }, 1553 | { 1554 | "cell_type": "code", 1555 | "execution_count": 139, 1556 | "metadata": {}, 1557 | "outputs": [ 1558 | { 1559 | "name": "stdout", 1560 | "output_type": "stream", 1561 | "text": [ 1562 | "234 Gözde 3.23\n" 1563 | ] 1564 | } 1565 | ], 1566 | "source": [ 1567 | "print(\"{2} {0} {1}\".format(\"Gözde\",3.23,234))" 1568 | ] 1569 | }, 1570 | { 1571 | "cell_type": "code", 1572 | "execution_count": 140, 1573 | "metadata": {}, 1574 | "outputs": [], 1575 | "source": [ 1576 | "liste=[\"Beykoz\",2019,3.56,\"Üniversite\",True]" 1577 | ] 1578 | }, 1579 | { 1580 | "cell_type": "code", 1581 | "execution_count": 141, 1582 | "metadata": {}, 1583 | "outputs": [ 1584 | { 1585 | "data": { 1586 | "text/plain": [ 1587 | "'Beykoz'" 1588 | ] 1589 | }, 1590 | "execution_count": 141, 1591 | "metadata": {}, 1592 | "output_type": "execute_result" 1593 | } 1594 | ], 1595 | "source": [ 1596 | "liste[0]" 1597 | ] 1598 | }, 1599 | { 1600 | "cell_type": "code", 1601 | "execution_count": 142, 1602 | "metadata": {}, 1603 | "outputs": [ 1604 | { 1605 | "data": { 1606 | "text/plain": [ 1607 | "['Beykoz', 2019, 3.56, 'Üniversite']" 1608 | ] 1609 | }, 1610 | "execution_count": 142, 1611 | "metadata": {}, 1612 | "output_type": "execute_result" 1613 | } 1614 | ], 1615 | "source": [ 1616 | "liste[0:4]" 1617 | ] 1618 | }, 1619 | { 1620 | "cell_type": "code", 1621 | "execution_count": 143, 1622 | "metadata": {}, 1623 | "outputs": [ 1624 | { 1625 | "data": { 1626 | "text/plain": [ 1627 | "[True, 'Üniversite', 3.56, 2019, 'Beykoz']" 1628 | ] 1629 | }, 1630 | "execution_count": 143, 1631 | "metadata": {}, 1632 | "output_type": "execute_result" 1633 | } 1634 | ], 1635 | "source": [ 1636 | "liste[::-1]" 1637 | ] 1638 | }, 1639 | { 1640 | "cell_type": "code", 1641 | "execution_count": 144, 1642 | "metadata": {}, 1643 | "outputs": [ 1644 | { 1645 | "data": { 1646 | "text/plain": [ 1647 | "'e'" 1648 | ] 1649 | }, 1650 | "execution_count": 144, 1651 | "metadata": {}, 1652 | "output_type": "execute_result" 1653 | } 1654 | ], 1655 | "source": [ 1656 | "liste[0][1]" 1657 | ] 1658 | }, 1659 | { 1660 | "cell_type": "code", 1661 | "execution_count": 145, 1662 | "metadata": {}, 1663 | "outputs": [ 1664 | { 1665 | "data": { 1666 | "text/plain": [ 1667 | "'Beykoz'" 1668 | ] 1669 | }, 1670 | "execution_count": 145, 1671 | "metadata": {}, 1672 | "output_type": "execute_result" 1673 | } 1674 | ], 1675 | "source": [ 1676 | "liste[0]" 1677 | ] 1678 | }, 1679 | { 1680 | "cell_type": "code", 1681 | "execution_count": 146, 1682 | "metadata": {}, 1683 | "outputs": [ 1684 | { 1685 | "data": { 1686 | "text/plain": [ 1687 | "'B'" 1688 | ] 1689 | }, 1690 | "execution_count": 146, 1691 | "metadata": {}, 1692 | "output_type": "execute_result" 1693 | } 1694 | ], 1695 | "source": [ 1696 | "liste[0][0]" 1697 | ] 1698 | }, 1699 | { 1700 | "cell_type": "code", 1701 | "execution_count": 147, 1702 | "metadata": {}, 1703 | "outputs": [ 1704 | { 1705 | "data": { 1706 | "text/plain": [ 1707 | "['Beykoz', 2019, 3.56, 'Üniversite', True]" 1708 | ] 1709 | }, 1710 | "execution_count": 147, 1711 | "metadata": {}, 1712 | "output_type": "execute_result" 1713 | } 1714 | ], 1715 | "source": [ 1716 | "liste" 1717 | ] 1718 | }, 1719 | { 1720 | "cell_type": "code", 1721 | "execution_count": 148, 1722 | "metadata": {}, 1723 | "outputs": [ 1724 | { 1725 | "name": "stdout", 1726 | "output_type": "stream", 1727 | "text": [ 1728 | "['Beykoz', 2019, 3.56, 'Üniversite', True]\n" 1729 | ] 1730 | } 1731 | ], 1732 | "source": [ 1733 | "print(liste)" 1734 | ] 1735 | }, 1736 | { 1737 | "cell_type": "code", 1738 | "execution_count": 149, 1739 | "metadata": {}, 1740 | "outputs": [ 1741 | { 1742 | "ename": "TypeError", 1743 | "evalue": "'int' object is not subscriptable", 1744 | "output_type": "error", 1745 | "traceback": [ 1746 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 1747 | "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", 1748 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mliste\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 1749 | "\u001b[1;31mTypeError\u001b[0m: 'int' object is not subscriptable" 1750 | ] 1751 | } 1752 | ], 1753 | "source": [ 1754 | "liste[1][0] #int bu şekilde parçalanamaz" 1755 | ] 1756 | }, 1757 | { 1758 | "cell_type": "code", 1759 | "execution_count": 150, 1760 | "metadata": {}, 1761 | "outputs": [], 1762 | "source": [ 1763 | "liste[1]=\"2019\"" 1764 | ] 1765 | }, 1766 | { 1767 | "cell_type": "code", 1768 | "execution_count": 151, 1769 | "metadata": {}, 1770 | "outputs": [ 1771 | { 1772 | "data": { 1773 | "text/plain": [ 1774 | "['Beykoz', '2019', 3.56, 'Üniversite', True]" 1775 | ] 1776 | }, 1777 | "execution_count": 151, 1778 | "metadata": {}, 1779 | "output_type": "execute_result" 1780 | } 1781 | ], 1782 | "source": [ 1783 | "liste" 1784 | ] 1785 | }, 1786 | { 1787 | "cell_type": "code", 1788 | "execution_count": 153, 1789 | "metadata": {}, 1790 | "outputs": [], 1791 | "source": [ 1792 | "liste2=[10,50,2,12,5]" 1793 | ] 1794 | }, 1795 | { 1796 | "cell_type": "code", 1797 | "execution_count": 154, 1798 | "metadata": {}, 1799 | "outputs": [], 1800 | "source": [ 1801 | "liste2.sort()" 1802 | ] 1803 | }, 1804 | { 1805 | "cell_type": "code", 1806 | "execution_count": 155, 1807 | "metadata": {}, 1808 | "outputs": [ 1809 | { 1810 | "data": { 1811 | "text/plain": [ 1812 | "[2, 5, 10, 12, 50]" 1813 | ] 1814 | }, 1815 | "execution_count": 155, 1816 | "metadata": {}, 1817 | "output_type": "execute_result" 1818 | } 1819 | ], 1820 | "source": [ 1821 | "liste2" 1822 | ] 1823 | }, 1824 | { 1825 | "cell_type": "code", 1826 | "execution_count": 156, 1827 | "metadata": {}, 1828 | "outputs": [], 1829 | "source": [ 1830 | "liste2.reverse()" 1831 | ] 1832 | }, 1833 | { 1834 | "cell_type": "code", 1835 | "execution_count": 157, 1836 | "metadata": {}, 1837 | "outputs": [ 1838 | { 1839 | "data": { 1840 | "text/plain": [ 1841 | "[50, 12, 10, 5, 2]" 1842 | ] 1843 | }, 1844 | "execution_count": 157, 1845 | "metadata": {}, 1846 | "output_type": "execute_result" 1847 | } 1848 | ], 1849 | "source": [ 1850 | "liste2" 1851 | ] 1852 | }, 1853 | { 1854 | "cell_type": "code", 1855 | "execution_count": 158, 1856 | "metadata": {}, 1857 | "outputs": [], 1858 | "source": [ 1859 | "liste2.sort(reverse=True) #Büyükten küçüğe sıralanır" 1860 | ] 1861 | }, 1862 | { 1863 | "cell_type": "code", 1864 | "execution_count": 159, 1865 | "metadata": {}, 1866 | "outputs": [ 1867 | { 1868 | "data": { 1869 | "text/plain": [ 1870 | "[50, 12, 10, 5, 2]" 1871 | ] 1872 | }, 1873 | "execution_count": 159, 1874 | "metadata": {}, 1875 | "output_type": "execute_result" 1876 | } 1877 | ], 1878 | "source": [ 1879 | "liste2" 1880 | ] 1881 | }, 1882 | { 1883 | "cell_type": "code", 1884 | "execution_count": 160, 1885 | "metadata": {}, 1886 | "outputs": [], 1887 | "source": [ 1888 | "liste2.append(30)" 1889 | ] 1890 | }, 1891 | { 1892 | "cell_type": "code", 1893 | "execution_count": 161, 1894 | "metadata": {}, 1895 | "outputs": [ 1896 | { 1897 | "data": { 1898 | "text/plain": [ 1899 | "[50, 12, 10, 5, 2, 30]" 1900 | ] 1901 | }, 1902 | "execution_count": 161, 1903 | "metadata": {}, 1904 | "output_type": "execute_result" 1905 | } 1906 | ], 1907 | "source": [ 1908 | "liste2" 1909 | ] 1910 | }, 1911 | { 1912 | "cell_type": "code", 1913 | "execution_count": 162, 1914 | "metadata": {}, 1915 | "outputs": [ 1916 | { 1917 | "data": { 1918 | "text/plain": [ 1919 | "[50, 12, 10, 5, 2]" 1920 | ] 1921 | }, 1922 | "execution_count": 162, 1923 | "metadata": {}, 1924 | "output_type": "execute_result" 1925 | } 1926 | ], 1927 | "source": [ 1928 | "liste2.pop()\n", 1929 | "liste2" 1930 | ] 1931 | }, 1932 | { 1933 | "cell_type": "code", 1934 | "execution_count": 163, 1935 | "metadata": {}, 1936 | "outputs": [ 1937 | { 1938 | "data": { 1939 | "text/plain": [ 1940 | "[50, 10, 5, 2]" 1941 | ] 1942 | }, 1943 | "execution_count": 163, 1944 | "metadata": {}, 1945 | "output_type": "execute_result" 1946 | } 1947 | ], 1948 | "source": [ 1949 | "liste2.pop(1)\n", 1950 | "liste2" 1951 | ] 1952 | }, 1953 | { 1954 | "cell_type": "code", 1955 | "execution_count": 164, 1956 | "metadata": {}, 1957 | "outputs": [ 1958 | { 1959 | "ename": "IndexError", 1960 | "evalue": "list index out of range", 1961 | "output_type": "error", 1962 | "traceback": [ 1963 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 1964 | "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", 1965 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mliste2\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 1966 | "\u001b[1;31mIndexError\u001b[0m: list index out of range" 1967 | ] 1968 | } 1969 | ], 1970 | "source": [ 1971 | "liste2[10] #olmayan bir indeks hata mesajı döndürür" 1972 | ] 1973 | }, 1974 | { 1975 | "cell_type": "code", 1976 | "execution_count": 165, 1977 | "metadata": {}, 1978 | "outputs": [ 1979 | { 1980 | "data": { 1981 | "text/plain": [ 1982 | "4" 1983 | ] 1984 | }, 1985 | "execution_count": 165, 1986 | "metadata": {}, 1987 | "output_type": "execute_result" 1988 | } 1989 | ], 1990 | "source": [ 1991 | "len(liste2)" 1992 | ] 1993 | }, 1994 | { 1995 | "cell_type": "code", 1996 | "execution_count": 166, 1997 | "metadata": {}, 1998 | "outputs": [ 1999 | { 2000 | "data": { 2001 | "text/plain": [ 2002 | "3" 2003 | ] 2004 | }, 2005 | "execution_count": 166, 2006 | "metadata": {}, 2007 | "output_type": "execute_result" 2008 | } 2009 | ], 2010 | "source": [ 2011 | "len(liste2)-1 #son elemanın indeksine ulaşırız" 2012 | ] 2013 | }, 2014 | { 2015 | "cell_type": "code", 2016 | "execution_count": 168, 2017 | "metadata": {}, 2018 | "outputs": [ 2019 | { 2020 | "name": "stdout", 2021 | "output_type": "stream", 2022 | "text": [ 2023 | "2\n" 2024 | ] 2025 | } 2026 | ], 2027 | "source": [ 2028 | "print(liste2[len(liste2)-1])" 2029 | ] 2030 | }, 2031 | { 2032 | "cell_type": "code", 2033 | "execution_count": null, 2034 | "metadata": {}, 2035 | "outputs": [], 2036 | "source": [] 2037 | } 2038 | ], 2039 | "metadata": { 2040 | "kernelspec": { 2041 | "display_name": "Python 3", 2042 | "language": "python", 2043 | "name": "python3" 2044 | }, 2045 | "language_info": { 2046 | "codemirror_mode": { 2047 | "name": "ipython", 2048 | "version": 3 2049 | }, 2050 | "file_extension": ".py", 2051 | "mimetype": "text/x-python", 2052 | "name": "python", 2053 | "nbconvert_exporter": "python", 2054 | "pygments_lexer": "ipython3", 2055 | "version": "3.7.1" 2056 | } 2057 | }, 2058 | "nbformat": 4, 2059 | "nbformat_minor": 2 2060 | } 2061 | --------------------------------------------------------------------------------