diff --git a/MisCalculator.py b/MisCalculator.py new file mode 100644 index 0000000..87814fa --- /dev/null +++ b/MisCalculator.py @@ -0,0 +1,36 @@ +from math import ceil +def toplama(): + x = a + b + print(x) + +def cikarma(): + x = a - b + print(x) + +def bolme(): + x = a / b + print(x) + +def carpma(): + x = a * b + print(x) +while True: + try: + a = ceil(float(input('Lutfen birinci sayi giriniz: '))) + b = ceil(float(input('Lutfen ikinci sayiyi giriniz: '))) + c = int(input('Toplama icin "1"e , Cikarma icin "2", Bolme icin "3", Carpma icin"4" , Cikis icin "0"a basiniz: ')) + if c == 1: + toplama() + elif c ==2: + cikarma() + elif c ==3: + bolme() + elif c==4: + carpma() + elif c==0: + print('Iyi gunler') + break + except ZeroDivisionError: + print('Lutfen bolme yaparken ikinci sayiyi 0 girmeyiniz...') + + diff --git a/TheLeastCommonMultiple.py b/TheLeastCommonMultiple.py new file mode 100644 index 0000000..c0ce9cd --- /dev/null +++ b/TheLeastCommonMultiple.py @@ -0,0 +1,11 @@ +from math import gcd +try: + bir = int(input('1. sayiyi giriniz: ')) + iki = int(input('2. sayiyi giriniz: ')) + uc = int(input('3. sayiyi giriniz: ')) + dort = int(input('4. sayiyi giriniz: ')) + +except(ZeroDivisionError,ValueError): + Print('dikkat sayi giriniz') + +print("4 the least common multiple = ", gcd(bir,iki,uc,dort)) \ No newline at end of file diff --git a/numberGuessinGame.py b/numberGuessinGame.py new file mode 100644 index 0000000..cf5cf6e --- /dev/null +++ b/numberGuessinGame.py @@ -0,0 +1,17 @@ +import random +alt = int(input('Alt siniri giriniz: ')) +ust = int(input('Ust siniri giriniz: ')) +sayi = random.randint(alt, ust) +print(sayi) +a = 1 +while True: + tahmin = int(input('Lutfen giridigiz aralikta sayi giriniz: ')) + if (tahmin < sayi): + print('Girdiginiz sayi istenen sayidan kucuktur...') + elif (tahmin > sayi): + print('Girdiginiz sayi istenen sayidan buyuktur... ') + elif ( tahmin == sayi): + print('Tebrikler iyi tahmin ettiniz...') + break + a += 1 +print('Sonucu: ',a, 'kerede bildiniz')