Python uses string find

Posted: March 17, 2015 in Python
Tags:

ddeger = “bir iki sen sekiz sen dokuz”

x = deger.find(“sen”)
print(“ilk sen :” , x)

y = deger.find(“sen”, x + 1)
print(“ikinci sen”, y)

x önce aradığımız kelimenin ilk index döndürecektir.İkincisi ise ikinci sen kelimesini bulup onun koordinatını verecektir.

31

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s