This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8-*- | |
#!/usr/bin/python | |
while True : | |
isim = raw_input("isminizi giriniz:") | |
print "Merhaba %s numaranı gir."%(isim) | |
n = raw_input("numaranızı giriniz:") | |
if n=='019' : | |
print "Bu numara Ali adlı kullanıcıya aittir." | |
elif n=='043' : | |
print "Bu numara Mehmet adlı kullanıcıya aittir." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#!/usr/bin/python | |
def kok_hesapla(a,b,c): | |
delta=(b**2)-(4*a*c) | |
if delta>=0: | |
birinci_kok=(-b+(delta**0.5))/(2*a) | |
ikinci_kok=(-b-(delta**0.5))/(2*a) | |
print "Denklemin birinci kökü:",birinci_kok,"\n","Denklemin ikinci kökü:",ikinci_kok | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: cp1254 -*- | |
#!/usr/bin/python | |
def koordinat_bul(x,y): | |
if x>0 & y>0: | |
print"1.bölge" | |
elif x<0: | |
if y>0: | |
print"2.bölge" | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#!/usr/bin/python | |
while True : | |
kiLo=input("lütfen kilonuzu kg cinsinden giriniz:") | |
boy=input("lütfen boyunuzu birimi metre olacak şekilde giriniz:") | |
bmi=kiLo/(boy**2) | |
if bmi < 18.5 : | |
print "Zayıfsınız bünyenize dikkat ediniz." | |
elif 18.5 < bmi < 25 : | |
print "ideal kilodasınız." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: cp1254 -*- | |
#!/usr/bin/env python | |
#-*- coding: utf8 -*- | |
def yol_secici(x,y,z): | |
if x==0 and y==0 and z==0 : | |
print "a: 0\nb: 0\nc: 0\nd: 0\ne: 0\nf: 0\ng: 0" | |
elif x==0 and y==0 and z==1 : | |
print "a: 1\nb: 0\nc: 0\nd: 0\ne: 0\nf: 0\ng: 0" | |
elif x==0 and y==1 and z==0 : | |
print "a: 0\nb: 1\nc: 0\nd: 0\ne: 0\nf: 0\ng: 0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
def en_uzun_kelime(cumle): | |
liste = cumle.split() | |
uzunluklar = [] | |
for i in liste: | |
uzunluk = reduce(lambda x,y:len(i),liste) | |
uzunluklar.append(uzunluk) | |
en_uzun = max(uzunluklar) | |
sira = uzunluklar.index(en_uzun) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
#!/usr/bin/env python | |
import math,doctest | |
def mutlak(sayi): | |
""" | |
>>> mutlak(3+4j) | |
5.0 | |
>>> mutlak(-9) | |
9 | |
>>> mutlak(-17.5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
def en_buyuk_basamak(sayi): | |
a = repr(sayi) #Sayıyı karakter dizisine çeviriyoruz. | |
b = 0 #Basamak değeri en küçük sıfır olabileceğinden,değişkene sıfır değerini atıyoruz. | |
for i in a : | |
i = int(i) #a daki öğeyi integer'a çeviriyoruz. | |
if i >= b : b = i #eğer i deki değer b dekinden büyükse,değeri b ye atıyoruz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
def basamak_degeri_topla(sayi): | |
deger = 0 | |
while sayi : | |
basamak = sayi % 10 #Sayının modülünü alıp basamak degiskenine atadık. | |
sayi = sayi / 10 | |
deger += basamak #Basamak degerini,deger adlı değişkene atadık. | |
print "toplam = %s"% (deger) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int say1, say2, sonuc; | |
char tip; | |
printf("1. sayıyı giriniz: "); scanf("%d", &say1); | |
printf("2. sayıyı giriniz: "); scanf("%d", &say2); | |
printf("İşlem tipini giriniz (+,-,*,?): "); tip = getchar(); |
OlderNewer