Cohorts
  • Discover
  • About Us
  • Blog
  • Patika.dev
  • Web3

Python Temel

Programlama Nedir?
Jupyter Notebook
Temel Veri Tipleri
Değişken Atama
Kafa Karışıklığı
Operatörler ve İfadeler

Stringler
Stringler Üzerinde Operatörler
Stringlerde İndexleme
Stringlerde Casting

Input

Koda Yorum Ekleme

Sayısal Verilerde Karşılaştırma
Stringlerde Karşılaştırma
Mantıksal Operatörler
Short-circuit
Short-circuit Olmayan Mantıksal Operatörler

If-else-elif
Ternary Conditionals

Döngüler
while
for
Continue-Break

List
Tuple
in
Dictionary
Set
Non-scalar Veri Tiplerinde For
Split-Join
List Comprehension
Variable Unpacking
Enumerate-Zip

Fonksiyonlar
return
Comment-Fonksiyon
Birden Fazla Değer Döndürme/input İçerme
Predefined Parameters
Update Input
First Class Function
For-Function

Underscore Placeholder

fstring

Proje

Tuple


  • tuple veri tipi listeler gibi birden çok veri tipini bir arada tutmamızı sağlar.


  • listelerden farklı olarak tuple'lar immutabledır.


  • Mesela bir deniz fenerinin konumunu belirtmek istiyoruz. bunun x ve y koordinat değerleri var (x,y). Deniz fenerini söküp götüremiyoruz, ben bu iki değerin sabit, değiştirilemez olmasını istiyorum. Burada bu iki değeri tutmak için tuple kullanmam mantıklı olabilir.


  • Değişmeyeceğini bildiğim değerleri bir arada tutmak için.


  • tuple'lar (element1,element2...) şeklinde tanımlanır.


  • tuple'lar listeler gibi farklı veri yapılarında elemanlardan oluşabilir. Elemanları tuple bile olabilir.


x = 10
y = 34



konum = (10, 34)
  • Aynı listelerdeki gibi indexleme yapabiliyoruz.
konum[0]


10


konum[:]


(10, 34)
  • Ama değerlerini değiştiremiyoruz.
konum[0] = 100



---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-7-62043221042e> in <module>
----> 1 konum[0] = 100


TypeError: 'tuple' object does not support item assignment


  • Farklı veri tipleri barındırabiliyor.


t = (1,2,3,"a")


t


(1, 2, 3, 'a')


t = ((1,2),3)


t


t[0]



(1, 2)


t[1]



3


t = ([1,2,3],2,(1,2))


t


([1, 2, 3], 2, (1, 2))


t[0][0] = 23



t


([23, 2, 3], 2, (1, 2))


l = [[1,2,3], [10,20]]



l


[[1, 2, 3], [10, 20]]


Elemanların Değerlerini Değiştirmek

  • Diyelim ki x ve y'nin değerlerini değiştirmek istiyorum.
x = 2
y = 3


  • bunu şöyle yapabiliriz.


temp = x
x = y
y = temp


x



3


y



2
  • Ama bunu tuple'lar ile 1 satırda yapabiliriz.
x = 2
y = 3



(x, y) = (y, x)


x
3
y
2
  • parantez koymamıza da gerek yok. 1,2,3,"a"... gibi parantezsiz belirtsek de Python onu tuple olarak görüyor.
1,2,3,4
(1, 2, 3, 4)
a = 1,2,3,4
a
(1, 2, 3, 4)
type(a)
tuple
x = 2
y = 3



x, y = y, x
x
3
y
2
x = 2
y = 3



[x, y] = [y, x]


x
3
y
2


Quiz

Answer the questions to check your understanding.

This lesson includes a short quiz.

Previous
Next

Lesson discussion

Swap insights and ask questions about “Python Temel”.

Enroll to participate
Start the course to unlock the discussion. Enrolling helps us keep conversations relevant to learners.
Cohorts
WebsiteDiscoverBlogPatika.devRise In
CoursesCircleRustSoliditySolanaWeb3 FundamentalsBlockchain Basics
CompanyAbout UsTerms of UsePrivacy PolicyGDPR NoticeCookies
Don't miss any update!

Disclaimer: The information, programs, and events provided on https://cohorts.patika.dev is strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice, nor do we make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://cohorts.patika.dev disclaims any responsibility for financial decisions made by users based on the information provided here.

© 2026 Cohorts, All rights reserved