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

Enumerate:


  • for ile non-scalar yapılar içerisinde dolaşırken ya elemanları ya da indexleri üzerinde dolanmıştık, ama neden ikisi de aynı anda olmasın?


  • Variable Unpacking konusunda bir tuple, liste gibi yapıların değerlerini birden çok değişkene bir seferde eşitlemeyi görmüştük.


  • Bunun aynısını iterasyonda da yapabiliriz.


l = [(1,2), (10,20)]


for e in l:
    print(e)



(1, 2)
(10, 20)


for e in l:
    a, b = e
    print(a)
    print(b)
    print("*********")



1
2
*********
10
20
*********


for a, b in l:
    print("tuple'ın ilk elemanı", a)
    print("tuple'ın ikinci elemanı", b)
    print("-----------------------------")



tuple'ın ilk elemanı 1
tuple'ın ikinci elemanı 2
-----------------------------
tuple'ın ilk elemanı 10
tuple'ın ikinci elemanı 20
-----------------------------


  • enumerate() bize (index, element) olarak verecek.


adlar = ['Tyler', 'Blake', 'Cory', 'Cameron']


for e in adlar:
    print(e)


Tyler
Blake
Cory
Cameron



for i, e in enumerate(adlar):
    print(i, "indexindeki eleman:", e)



0 indexindeki eleman: Tyler
1 indexindeki eleman: Blake
2 indexindeki eleman: Cory
3 indexindeki eleman: Cameron
  • enumerate() 0'dan başlamak zorunda değil, özellikle kaçtan başlayacağını belirtebiliriz.
for i, e in enumerate(adlar, start = 100):
    print(i, "lokasyonunda bulunan eleman:", e)


100 lokasyonunda bulunan eleman: Tyler
101 lokasyonunda bulunan eleman: Blake
102 lokasyonunda bulunan eleman: Cory
103 lokasyonunda bulunan eleman: Cameron


zip()


  • Farklı yapıların içinde paralel iterasyon yapmamızı sağlar. zip()
ogrenciler = ["ogrenci_1", "ogrenci_2", "ogrenci_3"]


notlar = [90,80,72]


for s, g in zip(ogrenciler, notlar):
    print(s, g)


for e in zip(ogrenciler, notlar):
    print(e)


for i in range(len(ogrenciler)):
    print(ogrenciler[i], notlar[i])


zip() Örnek:


# Her ayki karı hesaplamak
satis = [3500.00, 76300.00, 67200.00]



maliyet = [56700.00, 21900.00, 12100.00]



for i in range(len(maliyet)):
    s = satis[i]
    c = maliyet[i]
    
    kar = s - c
    print(f'Total profit: {kar}')


Total profit: -53200.0
Total profit: 54400.0
Total profit: 55100.0



satis = [3500.00, 76300.00, 67200.00]
maliyet = [56700.00, 21900.00, 12100.00]
for s, c in zip(satis, maliyet):
    kar = s - c
    print(f'Total profit: {kar}')


Total profit: -53200.0
Total profit: 54400.0
Total profit: 55100.0


zip() ile Dictionary Yaratmak:

keys = ['isim', 'soyad', 'ulke', 'is']
values = ['Denis', 'Walker', 'Turkey', 'data scientist']


d = {}


for k, v in zip(keys, values):
    d[k] = v


d



{'isim': 'Denis', 'soyad': 'Walker', 'ulke': 'Turkey', 'is': 'data scientist'}


d["isim"]



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