diff --git a/Week 4-1.Odev Random Password.py b/Week 4-1.Odev Random Password.py new file mode 100644 index 0000000..5ba7ab9 --- /dev/null +++ b/Week 4-1.Odev Random Password.py @@ -0,0 +1,51 @@ + +# Import edilecek kutuphaneler +from tkinter import * +import random, string + +#Pencere Acilisi + +root =Tk() +root.geometry("400x400") +root.resizable(0,0) +root.title("FT SIFRE OLUSTURUCU") + +#Baslik +heading = Label(root, text = 'GENEL SIFRE' , font ='arial 15 bold').pack() +Label(root, text ='FATIH TURKMEN', font ='arial 15 bold').pack(side = BOTTOM) + + + +###Sifre Uzunlugu Secimi +pass_label = Label(root, text = 'SIFRE UZUNLUGU', font = 'arial 10 bold').pack() +pass_len = IntVar() +length = Spinbox(root, from_ = 1, to_ = 10 , textvariable = pass_len , width = 15).pack() + + + +#####Islev Tanimlamasi + +pass_str = StringVar() + +def Generator(): + password = '' + for x in range (0,4): + password = random.choice(string.ascii_uppercase)+random.choice(string.ascii_lowercase)+random.choice(string.digits)+random.choice(string.punctuation) + for y in range(pass_len.get()- 4): + password = password+random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits + string.punctuation) + pass_str.set(password) + + + +###Button Tanimlamasi + +Button(root, text = "SIFRE OLUSTUR" , command = Generator ).pack(pady= 5) + +Entry(root , textvariable = pass_str).pack() + + + + + +# loop to run program +root.mainloop() diff --git a/Week 4-2.Odev The Least Common Multiple.py b/Week 4-2.Odev The Least Common Multiple.py new file mode 100644 index 0000000..5c8e7cb --- /dev/null +++ b/Week 4-2.Odev The Least Common Multiple.py @@ -0,0 +1,23 @@ +import math +while(True): + try: + num_1 = int(input('num_1:')) + num_2 = int(input('num_2:')) + num_3 = int(input('num_3:')) + num_4 = int(input('num_4:')) + okek = math.lcm(num_1, num_2, num_3, num_4) + + print('L.C.M.....=', okek) + break + except (ValueError): + print('lUTFEN GIRISLERINIZI TEKRAR YAPINIZ YANLIS DEGER GIRDINIZ.......') + + + + + + + + + + diff --git a/Week 4-3.Odev Number Guessing Game.py b/Week 4-3.Odev Number Guessing Game.py new file mode 100644 index 0000000..e8356d6 --- /dev/null +++ b/Week 4-3.Odev Number Guessing Game.py @@ -0,0 +1,29 @@ +import random +import time + +tahminler = 0 +print('Lutfen isminizi giriniz....') +basla = time.time() + +kullanicinin_ismi = input('Isim-Soyisim...:') +numara = random.randint(1, 20) +print(kullanicinin_ismi + ', Ben 1 ile 20 arasinda bir sayi tuttum') +while tahminler < 6: + print('Benin tutdugum sayiyi bulmak icin bir tahmininde bulunurmusun....') # There are four spaces in front of print. + tahmin = input('Tahmin griniz...:') + tahmin = int(tahmin) + tahminler = tahminler + 1 + if tahmin < numara: + print('Senin tutdugun sayi benim tutdugum sayimdan dusuk.') # There are eight spaces in front of print. + if tahmin > numara: + print('Senin tutdugun sayi benim tutdugum sayimdan yuksek.') + if tahmin == numara: + break +if tahmin == numara: + tahminler = str(tahminler) + print('Harika, ' + kullanicinin_ismi + '! Tutdugum sayiyi buldunuz ' + tahminler + ' Tahminde!') +if tahmin != numara: + numara = str(numara) + print('HAYIR TAHMIN ETTIGIM SAYIYI BULAMADINIZ, tahmin ettigim sayi:' + numara) +son = int(time.time()-basla) +print("Toplam tahmin sureniz: {} Saniye".format(son)) diff --git a/Week 4-4.Odev Mis Calculator.py b/Week 4-4.Odev Mis Calculator.py new file mode 100644 index 0000000..c2a39a5 --- /dev/null +++ b/Week 4-4.Odev Mis Calculator.py @@ -0,0 +1,87 @@ +import toplama as tp +import cikarma as ck +import bolme as bl +import carpma as cr +print("Lutfen yapmak istediginiz islemi seciniz.......") +print("1.Toplama") +print("2.Cikarma") +print("3.Carpma") +print("4.Bolme") +while True: + secim = input("Lutfen yapiniz (1/2/3/4): ") + try: + if secim in ('1', '2', '3', '4'): + num1 = float(input("Ilk sayiyi giriniz: ")) + num2 = float(input("Ikinci sayiyi giriniz: ")) + if secim == '1': + topla=tp.tpl.toplama(num1,num2) + print(num1, "+", num2, "=", topla) + elif secim == '2': + cikar = ck.ckm.cikarma(num1, num2) + print(num1, "-", num2, "=",cikar ) + elif secim == '3': + carp = cr.crp.carpma(num1, num2) + print(num1, "*", num2, "=", carp) + elif secim == '4': + bol = bl.blm.bolme(num1, num2) + print(num1, "/", num2, "=", bol) + else: + print("Yanlis secim lutfen tekrar deneyiniz...............") + + tercih=input('Baska islem yapmak icin x e cikmak icin y ye basiniz......:') + if tercih=='y': + print('Isleminiz sona ermistir.........') + break + elif tercih=='x': + continue + else: + tercih=input('Baska islem yapmak icin x e cikmak icin y ye basiniz......:') + + + + + except (ValueError): + print('lUTFEN GIRISLERINIZI TEKRAR YAPINIZ YANLIS DEGER GIRDINIZ.......') + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bolme.py b/bolme.py new file mode 100644 index 0000000..786f799 --- /dev/null +++ b/bolme.py @@ -0,0 +1,3 @@ +class blm: + def bolme(x, y): + return x / y \ No newline at end of file diff --git a/carpma.py b/carpma.py new file mode 100644 index 0000000..80bc333 --- /dev/null +++ b/carpma.py @@ -0,0 +1,3 @@ +class crp: + def carpma(x, y): + return x * y \ No newline at end of file diff --git a/cikarma.py b/cikarma.py new file mode 100644 index 0000000..865f68e --- /dev/null +++ b/cikarma.py @@ -0,0 +1,3 @@ +class ckm: + def cikarma(x, y): + return x - y \ No newline at end of file diff --git a/toplama.py b/toplama.py new file mode 100644 index 0000000..543bba0 --- /dev/null +++ b/toplama.py @@ -0,0 +1,3 @@ +class tpl: + def toplama(x, y): + return x + y \ No newline at end of file