Python Eğitimi

Python ANA SAYFA Python Tanıtımı Python Başlarken Python Sözdizimi Python Yorumları Python Değişkenleri Python Veri Türleri Python Numaraları Python Döküm Python Dizeleri Python Boole'leri Python Operatörleri Python Listeleri piton demetleri Python Setleri Python Sözlükleri Python Eğer... Başka Python while Döngüleri Döngüler için Python Python Fonksiyonları piton lambda Python Dizileri Python Sınıfları/Nesneleri Python Kalıtımı Python Yineleyiciler Python Kapsamı Python Modülleri Python Tarihleri Python Matematik Python JSON'u Python Normal İfade Python PIP'si Python Deneyin... Hariç Python Kullanıcı Girişi Python Dize Biçimlendirme

Dosya yönetimi

Python Dosya İşleme Python Okuma Dosyaları Python Dosyaları Yazma/Oluşturma Python Dosyaları Sil

Python Modülleri

NumPy Eğitimi Panda İzlenecek Yol Scipy Eğitimi

Python Matplotlib'i

Matplotlib'e Giriş Matplotlib Başlarken Matplotlib Pyplot Matplotlib Çizimi Matplotlib İşaretçileri Matplotlib Hattı Matplotlib Etiketleri Matplotlib Izgarası Matplotlib Alt Noktaları Matplotlib Dağılımı Matplotlib Çubukları Matplotlib Histogramları Matplotlib Pasta Grafikleri

Makine öğrenme

Başlarken Ortalama Medyan Modu Standart sapma Yüzdelik Veri Dağıtımı Normal Veri Dağılımı Dağılım grafiği Doğrusal Regresyon Polinom Regresyon Çoklu regresyon Ölçek Tren/Test Karar ağacı

Python MySQL

MySQL'e Başlayın MySQL Veritabanı Oluştur MySQL Tablo Oluştur MySQL Ekle MySQL Seçimi MySQL Nerede MySQL Sıralaması MySQL Sil MySQL Bırakma Tablosu MySQL Güncellemesi MySQL Sınırı MySQL'e Katılma

Python MongoDB

MongoDB Başlarken MongoDB Veritabanı Oluştur MongoDB Koleksiyon Oluştur MongoDB Ekle MongoDB Bul MongoDB Sorgusu MongoDB Sıralaması MongoDB Sil MongoDB Damla Koleksiyonu MongoDB Güncellemesi MongoDB Sınırı

Python Referansı

Python'a Genel Bakış Python Yerleşik İşlevleri Python Dizisi Yöntemleri Python Liste Yöntemleri Python Sözlük Yöntemleri Python Tuple Yöntemleri Python Kümesi Yöntemleri Python Dosya Yöntemleri Python Anahtar Kelimeleri Python İstisnaları Python Sözlüğü

Modül Referansı

Rastgele Modül İstek Modülü İstatistik Modülü Matematik Modülü cMath Modülü

Python Nasıl Yapılır?

Liste Kopyalarını Kaldır Bir Dizeyi Ters Çevir İki Sayı Ekle

Python Örnekleri

Python Örnekleri Python Derleyici Python Alıştırmaları Python Testi Python Sertifikası

Python Operatörleri


Python Operatörleri

Operatörler, değişkenler ve değerler üzerinde işlem yapmak için kullanılır.

Aşağıdaki örnekte, +iki değeri bir araya getirmek için operatörü kullanıyoruz:

Örnek

print(10 + 5)

Python, operatörleri aşağıdaki gruplara ayırır:

  • Aritmetik operatörler
  • atama operatörleri
  • karşılaştırma operatörleri
  • Mantıksal operatörler
  • kimlik operatörleri
  • Üyelik operatörleri
  • bitsel operatörler

Python Aritmetik Operatörleri

Aritmetik operatörler, yaygın matematiksel işlemleri gerçekleştirmek için sayısal değerlerle birlikte kullanılır:

Operator Name Example Try it
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Modulus x % y
** Exponentiation x ** y
// Floor division x // y

Python Atama Operatörleri

Atama operatörleri, değişkenlere değer atamak için kullanılır:

Operator Example Same As Try it
= x = 5 x = 5
+= x += 3 x = x + 3
-= x -= 3 x = x - 3
*= x *= 3 x = x * 3
/= x /= 3 x = x / 3
%= x %= 3 x = x % 3
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
&= x &= 3 x = x & 3
|= x |= 3 x = x | 3
^= x ^= 3 x = x ^ 3
>>= x >>= 3 x = x >> 3
<<= x <<= 3 x = x << 3


Python Karşılaştırma Operatörleri

Karşılaştırma operatörleri iki değeri karşılaştırmak için kullanılır:

Operator Name Example Try it
== Equal x == y
!= Not equal x != y
> Greater than x > y
< Less than x < y
>= Greater than or equal to x >= y
<= Less than or equal to x <= y

Python Mantıksal Operatörleri

Mantıksal operatörler, koşullu ifadeleri birleştirmek için kullanılır:

Operator Description Example Try it
and  Returns True if both statements are true x < 5 and  x < 10
or Returns True if one of the statements is true x < 5 or x < 4
not Reverse the result, returns False if the result is true not(x < 5 and x < 10)

Python Kimlik Operatörleri

Kimlik operatörleri, nesneleri eşit olup olmadıklarını değil, aslında aynı nesneyse ve aynı bellek konumuna sahipse karşılaştırmak için kullanılır:

Operator Description Example Try it
is  Returns True if both variables are the same object x is y
is not Returns True if both variables are not the same object x is not y

Python Üyelik Operatörleri

Üyelik operatörleri, bir nesnede bir dizinin sunulup sunulmadığını test etmek için kullanılır:

Operator Description Example Try it
in  Returns True if a sequence with the specified value is present in the object x in y
not in Returns True if a sequence with the specified value is not present in the object x not in y

Python Bitsel Operatörler

Bitsel operatörler (ikili) sayıları karşılaştırmak için kullanılır:

Operator Name Description
AND Sets each bit to 1 if both bits are 1
| OR Sets each bit to 1 if one of two bits is 1
 ^ XOR Sets each bit to 1 if only one of two bits is 1
NOT Inverts all the bits
<< Zero fill left shift Shift left by pushing zeros in from the right and let the leftmost bits fall off
>> Signed right shift Shift right by pushing copies of the leftmost bit in from the left, and let the rightmost bits fall off

Egzersizlerle Kendinizi Test Edin

Egzersiz yapmak:

10ile çarpın 5ve sonucu yazdırın.

print(10  5)