Python-da Setirlerde Axtaris
Bir setir verilib:
txt = 'abcdef'
Yoxlayin ki, bu setir
'ac'
ile baslayir mi?
Bir siyahi verilib:
lst = ['12', '13', '14', '15']
Yoxlayin ki, onun elementleri
'1'
ile baslayir mi?
Bir eded verilib:
num = 123456
Yoxlayin ki, onun sonunda alti var mi?
Bir setir verilib:
txt = 'abcdef'
'c'
simvolunun indeksini tapin.
Bir setir verilib:
txt = 'ab1cd1ef'
'1'
simvolunun indeksini tapin, bu zaman axtarisi setirin ucuncu simvolundan yeddinci simvoluna qeder aparin.
Bir setir verilib:
txt = '123453637'
'3'
simvolunun son uygun gelme indeksini tapin.
Bir setir verilib:
txt = '2025.12.31'
'2'
simvolunun son uygun gelme indeksini tapin.
Bir eded verilib:
num = 24536589
Onda nece dene beslik oldugunu tapin.
Bir siyahi verilib:
lst = ['abc', 'cde', 'cbb', 'aeb']
Onun her bir elementinde nece dene
'b'
simvolu oldugunu tapin.
Bir setir verilib:
txt = 'http1://code.mu'
Asagidaki neticeni elde etmek ucun kodu yazin:
txt = 'https://code.mu'
Bir setir verilib:
txt = 'a.bc.d.ef'
Ondaki butun noqteleri bosluqlarla evez edin.