Ana sayfa Genel Pythonda Karakter Dizileri (Stringler)

Pythonda Karakter Dizileri (Stringler)


Tekrardan Hoşgeldiniz ! Bu konuda stringleri öğrenmeye çalışacağız.Pythonda bir veri tipi olan Stringler veya Türkçe ismiyle karakter dizileri gerçek hayatta kullandığımız yazıların aynısıdır.Bu veri tipi aslında her biri bir karakter olan bir dizidir. Örnek olarak, “ali” stringi sırasıyla a,l,i harflerinden veya karakterlerden oluşmaktadır. Bu konuda stringleri ve stringlerin özelliklerini görmeye çalışacağız.

String Oluşturma

Python’da string oluşturmanın birçok yolu bulunmaktadir.Bunların hangisini kullanacağınız tamamıyla size bağlıdır.İsterseniz string oluşturma işlemlerini görmeye çalışalım.

Burada dikkat etmemiz gereken nokta, eğer bir çift tırnak ile oluşturacaksak, stringin oluşturulması bitirmeyi yine çift tırnak ile yapmalıyız.

Peki şu şekilde bir stringi Pythonda nasıl tanımlarız: Murat’ın bugün dersi var.

Gördüğümüz gibi kodumuz sıkıntı çıkarttı. Çünkü karşılaştığı ilk  işaretini bitirme işareti olarak algıladı. Ancak şöyle bir kullanım sıkıntı yaratmayacaktır.

Şimdi de bir tane string veri tipinde değişken oluşturalım. Stringler de bir veri tipi oldukları için bunlardan değişken oluşturup kullanabiliriz.

Çıktı: Merhaba

String Indeksleme ve Parçalama

Stringler birer karakter dizileri oldukları için her bir karakterin aslında string içinde bir yeri vardır. Örnek olarak “ali” stringinde a,l ve i karakterlerinin yerleri indeksolarak adlandırılır.Pythonda ve genellikle çoğu programlama dilinde (Octave hariç) stringlerin indekslenmesi “0” dan başlamaktadır. Şimdi isterseniz bir string içindeki karakterlere indeks yoluyla nasıl ulaşacağımıza bakalım.


Pythonda stringler baştan olduğu gibi sondan da indekslenebilirler. Sondan başlayarak -1,-2 … şeklinde indekslenirler.

Peki uzun bir string’in sadece belirli bir kısmını elde etmek için ne yapacağız ? Bunun için indeksleri: ve [] işaretini kullanacağız. Formülümüz şu şekilde ;

[başlama indeksi : bitiş indeksi : atlama değeri]

İsterseniz örneklerimize bakalım.

String Özellikleri

Bir string’in uzunluğunu nasıl buluruz ? Bunun için Python’da len() fonksiyonu bulunmaktadır.

Peki sizce bir string’in belli bir karakterini direkt olarak değiştirebilir miyiz ? Hemen bir deneme yapalım.

Burada Python bu işleme izin vermedi. Gördüğümüz gibi, bir string’in karakterlerini direkt olarak değiştiremiyoruz.Çünkü stringler böyle bir işlemi desteklemiyor.

Peki, Pythonda stringler toplanabiliyor mu ? Python’da bunu yapmak da mümkündür.

Bir string ile bir sayıyı da çarpabiliriz.

Stringler konusu şimdilik bu kadar ! İleriki konularımızda stringlerimize tekrardan döneceğiz ve güzel özelliklerine bakma imkanına sahip olacağız.


  1. Proporcionar servicios de asistencia jurídica, apoyo ypromoción, para la tutela de los derechos de los menores,así como para la readaptación social de personas que han llevado a cabo conductas ilícitas. Otorgar en concurso abierto al público en general y conbase en la capacidad académica del candidato, becas para cursar estudios en escuelas con reconocimiento validez oficial. M.General: .995.204; M.Centro: 1.292.733; M.Comunidad: 1.292.731; M.Extrarradio: .471.400; Tlf/Fax: .800.885.

  2. Hi there are using WordPress for your site platform? I’m
    new to the blog world but I’m trying to get started and create my own.
    Do you require any coding expertise to make your own blog?
    Any help would be really appreciated!

  3. After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

  4. Every weekend i used to go to see this site,
    for the reason that i want enjoyment, for the reason that this this site conations truly good funny material too.

  5. Thank you for the sensible critique. Me & my neighbor were just preparing to do some research about this. We got a grab a book from our area library but I think I learned more clear from this post. I’m very glad to see such fantastic info being shared freely out there.

  6. A powerful share, I just given this onto a colleague who was doing just a little evaluation on this. And he in fact bought me breakfast because I discovered it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love reading more on this topic. If doable, as you turn out to be expertise, would you mind updating your weblog with more details? It is highly useful for me. Massive thumb up for this weblog publish!

  7. Throughout the great pattern of things you actually secure a B+ just for hard work. Where exactly you confused everybody ended up being on your specifics. As as the maxim goes, details make or break the argument.. And it couldn’t be much more accurate right here. Having said that, let me inform you what exactly did give good results. The article (parts of it) is certainly pretty engaging and this is possibly why I am making the effort to opine. I do not really make it a regular habit of doing that. Next, despite the fact that I can certainly see a leaps in logic you make, I am definitely not convinced of exactly how you seem to connect your points that produce the actual final result. For right now I will, no doubt subscribe to your issue but wish in the near future you actually link the facts better.

  8. I have read several excellent stuff here. Definitely price bookmarking for revisiting. I surprise how much effort you set to create this sort of wonderful informative web site.

  9. of course like your web-site however you need to test the spelling on several of your posts. Many of them are rife with spelling issues and I in finding it very bothersome to inform the truth on the other hand I¦ll surely come back again.

  10. I feel this is among the so much important info for me.
    And i am glad studying your article. However should statement on some general issues,
    The website taste is ideal, the articles is actually
    nice : D. Good activity, cheers

  11. Hello There. I discovered your blog the usage
    of msn. This is an extremely neatly written article.
    I’ll be sure to bookmark it and come back to read more of your helpful information. Thank you for the post.
    I’ll certainly comeback.

  12. I have learn a few just right stuff here. Definitely value bookmarking for revisiting. I surprise how much attempt you place to make this type of wonderful informative web site.

  13. I like this post, enjoyed this one regards for putting up. “We seldom attribute common sense except to those who agree with us.” by La Rochefoucauld.

  14. Thank you for all of the efforts on this web page. Kate take interest in participating in investigation and it’s obvious why. Most of us notice all concerning the compelling form you make both interesting and useful tricks through the web blog and as well strongly encourage response from other individuals on the issue then our favorite princess has always been learning a lot of things. Take pleasure in the remaining portion of the new year. You have been doing a splendid job.

  15. Great amazing issues here. I am very satisfied to see your article. Thanks a lot and i’m having a look forward to touch you. Will you kindly drop me a mail?

  16. Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across. It extremely helps make reading your blog significantly easier.

  17. What i don’t realize is if truth be told how you are now not really much more well-liked than you might be right now. You are very intelligent. You realize thus significantly in relation to this subject, made me personally imagine it from so many various angles. Its like men and women are not interested until it is one thing to do with Girl gaga! Your individual stuffs excellent. At all times deal with it up!

  18. Usually I don’t read post on blogs, but I wish to say that this write-up very forced me to try and do it! Your writing taste has been surprised me. Thanks, very nice article.

  19. Valuable information. Lucky me I found your site by accident, and I’m shocked why this accident didn’t happened earlier! I bookmarked it.

  20. Sling tv coupons and promo codes for november 2018
    Superb blog! Do you have any tips for aspiring writers?
    I’m hoping to start my own site soon but I’m a little lost on everything.
    Would you suggest starting with a free platform like WordPress or go for a paid
    option? There are so many options out there that I’m completely overwhelmed ..
    Any ideas? Appreciate it! Sling tv coupons and promo
    codes for november 2018

  21. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my old room mate! He always kept talking about this. I will forward this page to him. Fairly certain he will have a good read. Thanks for sharing!

  22. I cherished as much as you will obtain carried out proper here. The comic strip is attractive, your authored material stylish. nonetheless, you command get bought an nervousness over that you wish be turning in the following. sick no doubt come further before once more since exactly the same just about very steadily inside case you defend this hike.

  23. I’m not certain where you are getting your info, however great topic. I must spend a while learning much more or understanding more. Thanks for magnificent info I was looking for this information for my mission.

  24. Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.

  25. It’s perfect time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I wish to suggest you some interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more things about it!

  26. Hi there just wanted to give you a quick heads up. The words in your article seem to be running off the screen in Ie. I’m not sure if this is a formatting issue or something to do with browser compatibility but I thought I’d post to let you know. The design and style look great though! Hope you get the issue solved soon. Cheers

  27. Just wanna remark on few general things, The website design and style is perfect, the written content is very superb. “All movements go too far.” by Bertrand Russell.

  28. Excellent items from you, man. I have take into account your stuff prior to and you are just too great. I actually like what you have bought right here, really like what you’re saying and the way in which wherein you assert it. You are making it enjoyable and you continue to care for to stay it smart. I can not wait to learn much more from you. This is really a terrific website.

  29. Magnificent beat ! I would like to apprentice whilst you amend your web site, how
    could i subscribe for a weblog site? The account
    helped me a acceptable deal. I had been tiny bit familiar of this your broadcast provided bright
    clear concept

  30. Derma Veil ® 被喻為新世代逆齡完美輪廓塑造,最新一代的PLLA膠原。 2003年獲得Mexican Ministry of Health (SSA)認證及美國FDA出口認證,並於2006年在拉丁美洲及遠東至東南亞地區廣泛使用,多個臨床實例見證能改善老化、遺傳、疾病(如脂肪萎縮)等引起的凹陷問題,其效果備受認同。蘊含兩大活性成分均具有生物兼容性及分解性,可逐步被人體自然分解吸收,有效塑造童顏肌 : 1. 聚左乳酸 (Poly-L-lactic acid / PLLA) : 促進骨膠原生長 2. 甘醇酸(Glycolic Acid ) 使皮膚表皮層黏膠性脂質鬆軟,改善皮膚厚度,加速細胞再生,減少皺紋及疤痕,加強保濕功能,增加光澤,美白效果。 由於甘醇酸分子較小,容易滲透皮膚 治療前: 皮膚的凹陷/皺紋 治療後: 成分被人體吸收、並刺激膠原增生,撫平皺紋及凹陷部位。 注入BOTOX(保妥適)會抑制突觸前膜釋放神經遞質,阻斷乙酰膽鹼(Acetylcholine)的釋放,從而使肌肉張力下降或癱瘓麻痺,皺紋也隨之而逐漸消失。

  31. I discovered your blog site on google and check a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading more from you later on!…

  32. My partner and I stumbled over here by a different website and thought I might as well check things out. I like what I see so now i’m following you. Look forward to checking out your web page again.

  33. Pretty great post. I just stumbled upon your weblog and wished to say that I’ve truly loved surfing around your blog posts. In any case I will be subscribing in your feed and I hope you write once more soon!

  34. hello!,I love your writing very a lot! proportion we communicate extra approximately your post on AOL? I require an expert on this area to unravel my problem. May be that is you! Taking a look forward to look you.

  35. Thanks a lot for giving everyone a very remarkable possiblity to check tips from here. It is always very pleasant and jam-packed with a good time for me and my office fellow workers to visit your website at minimum three times per week to learn the latest items you have got. Not to mention, I’m also certainly motivated with the superb points you give. Some 1 areas on this page are rather the most efficient we’ve ever had.

  36. I am not sure where you’re getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for great information I was looking for this information for my mission.

  37. I will right away seize your rss as I can’t find your email subscription hyperlink or e-newsletter service. Do you’ve any? Kindly allow me understand in order that I may just subscribe. Thanks.

  38. Thank you for sharing superb informations. Your site is very cool. I am impressed by the details that you have on this site. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for extra articles. You, my pal, ROCK! I found simply the info I already searched all over the place and simply couldn’t come across. What a perfect web site.


Lütfen yorumunuzu giriniz
Buraya isminizi giriniz