Python Kəsim sintaksisi | dilimləmə slice | Python slicing syntax #kody_az
Dərs haqqında
Python-da dilimləmə (kəsim) ardıcıllıqdan (məsələn, siyahılar, sətirlər və ya tuples) müəyyən bir hissə almağın bir üsuludur.
Əsas Məlumatlar:
• Əgər start və ya stop göstərilməzsə, default olaraq başlanğıc (0) və son (len(sequence)) qiymətləri qəbul edilir.
• Əgər step göstərilməzsə, default olaraq 1 qəbul edilir.
• Mənfi step ardıcıllığı geriyə doğru keçməyə imkan verir.
• Mənfi indekslərdən istifadə edərək ardıcıllığın sonundakı elementlərə çatmaq olar.
===
In Python, slicing is a way to retrieve a subset of values from a sequence (like lists, strings, or tuples).
Key Points:
• If start or stop are omitted, the default values are the beginning (0) and end (len(sequence)), respectively.
• If step is omitted, it defaults to 1.
• Negative steps traverse the sequence in reverse.
• You can use negative indices to access elements from the end of the sequence.
#python #kody_az #kodyaz #viral #viralcode #viralvideo #random #code #coder #azerbaycan #azerbaijan #azərbaycan #baku #baki #programming #programmer #codes #hazırlıq #hazirliq #kurs #kurslar #course #courses #online #onlinecourses #test #quiz