Ana sayfa Programlama Pythonda Operatörler

Pythonda Operatörler

7798
253
PAYLAŞ

Matematik Operatörleri

Tekrardan hoşgeldiniz.

Python’da ve diğer programlama dillerinde matematik operatörleri oldukça önemlidir. Bu konumuzda, Pythondaki matematik operatörlerini öğreneceğiz.

Toplama İşlemi (+)

Python’da toplama işlemi şu şekilde yapılabilmektedir.

Çıktı: 29

Çıktı: 7.9

Çıkarma İşlemi (-)

Python’da çıkarma işlemi şu şekilde yapılabilmektedir.


Çıktı: -47

Çıktı: -6

Çıktı: -2.6999999999999997

Çarpma İşlemi (*)

Python’da çarpma işlemi şu şekilde yapılabilmektedir.

Çıktı: 20

Çıktı: 14.13

Çıktı : 60

Çıktı: 9.42

Bölme İşlemi (/)

Python’da bölme işlemi şu şekilde yapılabilmektedir.

Çıktı: 2.0

Çıktı: 3.333333333335

Çıktı: 3.142857142857143

Şimdi, burada matematikten farklı olarak bir şey gerçekleşti. “4 / 2” işleminin sonucunun “2” olarak çıkması gerekirken, sonuç “2.0” olarak, yani ondalıklı olarak(float) çıktı. Bu özellik, Python 3’e işlem sonucunun daha kesin bir şekilde sağlanması için konulmuş bir özellik. Bunları ilerde çok daha iyi bir şekilde anlayacağız.

Peki bir sayının başka bir sayıya bölümünden çıkan bölüm sonucunu nasıl bulacağız ? Bunun için de Python3’te şu şekilde bir operatör mevcut.

Tamsayı Bölmesi (//)

Bu operatör, bir sayının başka bir sayıya bölümünden ortaya çıkan bölüm sonucunu vermektedir.Örneklerimize bakalım.

Çıktı: 2

Çıktı: 3

Kalanı Bulma (%)

Bu operatör de , bir sayının başka bir sayıya bölümünden kalan sonucunu bulmamızı sağlar.

Çıktı: 1

Üs bulma (**)

Bu operatör bir sayının üssünü bulmamızı sağlar. Örnek olarak operatörün solundaki sayının sağdaki sayıya göre üssünü ekrana basar.


Çıktı: 64

Peki bir sayının karekökünü nasıl bulacağız ? Matematikten bildiğimiz gibi, bir sayının karekökü , o sayının 1/2 (0.5). üssüdür. O zaman örneğimizle 64 sayısının karekökünü bulmaya çalışalım.

Çıktı: 8.0

Operatörleri beraber kullanma ve İşlem sırası

Bütün bu öğrendiğimiz şeyleri beraber nasıl kullanabiliriz? Bunun için matematikteki işlem sırasını biliyorsak çok rahat edeceğiz, çünkü Pythondaki işlem sırası matematiktekiyle birebir aynıdır. Nedir bu işlem sırası ? Kurallar şunlar ;

  • 1. Parantez içi her zaman önce yapılır.
  •  Çarpma ve Bölme her zaman Toplama ve Çıkarma işlemine göre önce yapılır.
  • İşlemler soldan sağa değerlendirilir.

Ancak, buradaki işlemleri ezberlememize hiç gerek yok. Kafamızın karıştığı yerler de işlemleri parantez içine almak, hayat kurtarır 🙂 Şimdi örneklere bakalım.

Çıktı: -4.0

Çıktı: -4.0

İşte matematik operatörleri tamamıyla bu şekilde !

Bir diğer yazımızda Karakter Dizilerini (string) öğreneceğiz.

253 YORUMLAR

  1. I’m often to running a blog and i actually admire your content. The article has actually peaks my interest. I am going to bookmark your site and preserve checking for brand new information.

  2. Hi! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no data backup. Do you have any methods to prevent hackers?

  3. Greetings! I know this is kinda off topic but I was wondering if you knew where
    I could find a captcha plugin for my comment form?
    I’m using the same blog platform as yours and
    I’m having trouble finding one? Thanks a lot!

  4. Good website! I truly love how it is simple on my eyes and the data are well written. I am wondering how I might be notified whenever a new post has been made. I’ve subscribed to your RSS which must do the trick! Have a nice day!

  5. I’ve been exploring for a little for any high-quality articles or weblog posts in this kind of area . Exploring in Yahoo I finally stumbled upon this site. Studying this information So i am happy to exhibit that I’ve an incredibly just right uncanny feeling I came upon exactly what I needed. I so much no doubt will make certain to do not omit this web site and provides it a glance regularly.

  6. After I originally commented I seem to have clicked on the -Notify me when new comments are added- checkbox and now whenever a comment
    is added I get four emails with the exact same comment.
    Perhaps there is an easy method you are able to remove
    me from that service? Cheers!

  7. I’m extremely inspired together with your writing skills as neatly as with the structure to your blog. Is that this a paid theme or did you modify it your self? Anyway stay up the nice quality writing, it’s rare to peer a great blog like this one nowadays..

  8. Wonderful beat ! I wish to apprentice while you amend your website, how can i subscribe for a blog website? The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear concept

  9. F*ckin¦ tremendous issues here. I am very happy to look your post. Thank you a lot and i’m looking forward to contact you. Will you please drop me a mail?

  10. Woah! I’m really enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very difficult to get that “perfect balance” between user friendliness and appearance. I must say you have done a excellent job with this. Also, the blog loads very fast for me on Opera. Superb Blog!

  11. Excellent weblog here! Additionally your website loads up fast! What host are you using? Can I am getting your affiliate hyperlink to your host? I desire my site loaded up as quickly as yours lol

  12. I really enjoy reading through on this internet site, it holds wonderful blog posts. “The living is a species of the dead and not a very attractive one.” by Friedrich Wilhelm Nietzsche.

  13. I have learn a few good stuff here. Definitely value bookmarking for revisiting. I surprise how a lot effort you place to make the sort of magnificent informative website.

  14. Amazing blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple tweeks would really make my blog jump out. Please let me know where you got your design. Thanks a lot

  15. This design is incredible! You definitely know how to keep
    a reader amused. Between your wit and your videos, I was almost moved to start
    my own blog (well, almost…HaHa!) Excellent job.
    I really enjoyed what you had to say, and
    more than that, how you presented it. Too cool!

  16. Fantastic beat ! I would like to apprentice even as you amend your website, how can i subscribe for a blog web site? The account aided me a applicable deal. I have been a little bit familiar of this your broadcast provided brilliant clear concept

  17. I’m so happy to read this. This is the type of manual that needs to be given and not the random misinformation that’s at the other blogs. Appreciate your sharing this greatest doc.

  18. Hey, I think your site might be having browser compatibility issues. When I look at your blog in Firefox, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, superb blog!

  19. Nice weblog right here! Additionally your site loads up very fast! What web host are you using? Can I get your affiliate link for your host? I want my web site loaded up as fast as yours lol

  20. Hey just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Opera. I’m not sure if this is a format issue or something to do with web browser compatibility but I thought I’d post to let you know. The design and style look great though! Hope you get the problem fixed soon. Cheers

  21. When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!

  22. I’m impressed, I must say. Actually not often do I encounter a blog that’s each educative and entertaining, and let me inform you, you’ve hit the nail on the head. Your idea is outstanding; the difficulty is one thing that not sufficient individuals are talking intelligently about. I am very pleased that I stumbled throughout this in my search for something referring to this.

  23. Hi there very nice site!! Guy .. Excellent .. Wonderful .. I will bookmark your web site and take the feeds also?KI am satisfied to search out so many helpful info here within the post, we want develop more techniques on this regard, thank you for sharing. . . . . .

  24. 通過水光療程抑制黑色素細胞生長的成分注射到真皮層,減少黑色素形成,淡化黑斑色素沉澱,從而達到美白祛斑的效果 療程特色 :可配搭多元化產品來量身訂做不同療​​程計算機化規格,操作方便,容易控制可調節進針深度,精準注射於目標的肌膚層 每針的注射劑量相等,達到均勻注射 一次平均5點注射,可縮短療程時間 採用31號細針頭,幾乎看不到入針點 降低疼痛、瘀血、腫脹及不適感 使用靈活度高,可複合式搭配針劑,量身訂製療程

  25. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!

  26. Howdy, simply become mindful of your own web site by way of Yahoo and google, determined that must be seriously educational.. koleksi vlogger terbaik I’m just usually watchful with regard to belgium’s capital. I’m going to love for individuals who carry on this later on. Many people is usually benefited from the creating. Regards!

  27. Fantastic goods from you, man. I’ve understand your stuff previous to and you’re just too fantastic. I really like what you’ve acquired here, certainly like what you are stating and the way in which you say it. You make it enjoyable and you still care for to keep it wise. I cant wait to read much more from you. This is actually a wonderful web site.

  28. What i don’t realize is in truth how you are no longer actually a lot more smartly-preferred than you may be right now. You are so intelligent. You understand therefore considerably in terms of this topic, made me for my part consider it from numerous numerous angles. Its like women and men don’t seem to be fascinated except it is something to do with Woman gaga! Your personal stuffs excellent. Always maintain it up!

  29. Howdy just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Chrome. I’m not sure if this is a format issue or something to do with internet browser compatibility but I thought I’d post to let you know. The layout look great though! Hope you get the issue fixed soon. Kudos

  30. Hi my loved one! I want to say that this article is amazing, great written and
    include almost all important infos. I would like to peer extra posts like this .

  31. hello there and thanks to your info – I have certainly picked up something new from right here. I did alternatively experience several technical points using this web site, since I experienced to reload the web site a lot of times prior to I could get it to load correctly. I were brooding about if your hosting is OK? Now not that I’m complaining, but sluggish loading cases instances will sometimes have an effect on your placement in google and could harm your high quality rating if ads and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I’m including this RSS to my e-mail and could glance out for a lot more of your respective exciting content. Ensure that you replace this again soon..

  32. I like the helpful information you supply for your articles. I’ll bookmark your weblog and take a look at once more right here frequently. I’m rather sure I will be told many new stuff proper here! Best of luck for the following!

  33. of course as if your internet site however you need to check out the spelling upon a number of you. A few of options rife by using punctuation challenges so i to uncover them incredibly problematic to express to the fact on the other hand I am going to unquestionably give back all over again.. apa itu trading saham

  34. Hiya! I know this is kinda off topic nevertheless I’d figured I’d ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My website discusses a lot of the same subjects as yours and I believe we could greatly benefit from each other. If you might be interested feel free to shoot me an email. I look forward to hearing from you! Awesome blog by the way!

  35. I do agree with all the ideas you have introduced on your post. They’re very convincing and can definitely work. Still, the posts are very quick for beginners. May you please lengthen them a little from next time? Thanks for the post.

  36. Hello! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My blog goes over a lot of the same subjects as yours and I feel we could greatly benefit from each other. If you’re interested feel free to send me an email. I look forward to hearing from you! Superb blog by the way!

  37. I absolutely love your blog and find most of your post’s to be just what I’m looking for. can you offer guest writers to write content available for you? I wouldn’t mind composing a post or elaborating on many of the subjects you write concerning here. Again, awesome blog!

  38. I haven¦t checked in here for some time as I thought it was getting boring, but the last several posts are great quality so I guess I¦ll add you back to my daily bloglist. You deserve it my friend 🙂

  39. Good post. I be taught one thing more difficult on different blogs everyday. It is going to all the time be stimulating to learn content from different writers and apply slightly something from their store. I’d want to use some with the content on my blog whether you don’t mind. Natually I’ll offer you a link in your internet blog. Thanks for sharing.

  40. Good web site! I really love how it is easy on my eyes and the data are well written. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your feed which must do the trick! Have a great day!

  41. Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

  42. Hi! This post could not be written any better! Reading this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Fairly certain he will have a good read. Thank you for sharing!

  43. Howdy this is somewhat of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!

  44. I got what you intend, thankyou for putting up.Woh I am pleased to find this website through google. “Those who corrupt the public mind are just as evil as those who steal from the public.” by Theodor Wiesengrund Adorno.

  45. Hiya, I’m really glad I have found this info. Today bloggers publish only about gossips and internet and this is really frustrating. A good website with interesting content, that is what I need. Thank you for keeping this website, I’ll be visiting it. Do you do newsletters? Cant find it.

  46. Howdy very cool blog!! Man .. Beautiful .. Wonderful .. I will bookmark your website and take the feeds also…I’m happy to seek out numerous useful information right here within the post, we want develop extra strategies on this regard, thank you for sharing.

  47. I do accept as true with all of the concepts you have presented to your post. They’re really convincing and will definitely work. Nonetheless, the posts are too quick for novices. May just you please extend them a little from subsequent time? Thanks for the post.

  48. Hey very cool web site!! Man .. Excellent .. Amazing .. I will bookmark your blog and take the feeds also…I am happy to find so many useful information here in the post, we need develop more techniques in this regard, thanks for sharing. . . . . .

  49. You really make it appear so easy together with your presentation however I find this topic to be actually something that I think I would by no means understand. It seems too complex and very huge for me. I’m looking forward on your subsequent submit, I’ll try to get the hang of it!

  50. naturally like your web-site but you have to check the spelling on quite a few of your posts. Several of them are rife with spelling issues and I find it very troublesome to tell the truth nevertheless I’ll surely come back again.

  51. Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

  52. Most of what you claim is astonishingly precise and it makes me ponder the reason why I had not looked at this with this light before. This piece truly did switch the light on for me as far as this particular topic goes. Nonetheless there is actually one issue I am not necessarily too cozy with and whilst I attempt to reconcile that with the actual main idea of your position, let me observe just what the rest of the visitors have to say.Very well done.

  53. Nice read, I just passed this onto a colleague who was doing a little research on that. And he just bought me lunch because I found it for him smile Therefore let me rephrase that: Thank you for lunch!

  54. I have been absent for some time, but now I remember why I used to love this web site. Thanks, I’ll try and check back more frequently. How frequently you update your web site?

  55. 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.

  56. naturally like your web-site however you need to check the spelling on several of your posts. Several of them are rife with spelling issues and I in finding it very bothersome to inform the truth nevertheless I’ll surely come back again.

  57. I would like to thank you for the efforts you have put in writing this site. I’m hoping the same high-grade web site post from you in the upcoming as well. In fact your creative writing skills has inspired me to get my own web site now. Actually the blogging is spreading its wings fast. Your write up is a good example of it.

  58. Great V I should certainly pronounce, impressed with your web site. I had no trouble navigating through all tabs and related information ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your client to communicate. Excellent task..

  59. Someone necessarily assist to make seriously posts I might state. This is the first time I frequented your website page and so far? I surprised with the analysis you made to make this particular submit amazing. Magnificent job!

  60. Those are yours alright! . We at least need to get these people stealing images to start blogging! They probably just did a image search and grabbed them. They look good though!

  61. Hi there are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you need any html coding knowledge to make your own blog? Any help would be greatly appreciated!

  62. you are actually a good webmaster. The web site loading pace is incredible. It kind of feels that you’re doing any distinctive trick. In addition, The contents are masterwork. you have done a great task on this subject!

  63. There are some attention-grabbing deadlines in this article but I don’t know if I see all of them center to heart. There’s some validity however I will take maintain opinion until I look into it further. Good article , thanks and we want more! Added to FeedBurner as effectively

  64. I have recently started a website, the information you offer on this site has helped me greatly. Thank you for all of your time & work.

  65. I just could not leave your site before suggesting that I actually enjoyed the usual info an individual provide to your visitors? Is gonna be back ceaselessly to investigate cross-check new posts

  66. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

  67. We’re a group of volunteers and starting a brand new scheme in our community. Your web site offered us with useful information to paintings on. You’ve done an impressive process and our entire group can be grateful to you.

  68. I would like to thnkx for the efforts you have put in writing this blog. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings quickly. Your write up is a good example of it.

  69. Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research on this. We got a grab a book from our local library but I think I learned more from this post. I’m very glad to see such fantastic information being shared freely out there.

  70. I’d have to check with you here. Which is not something I often do! I get pleasure from studying a publish that can make folks think. Also, thanks for permitting me to comment!

  71. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

  72. I’ve been exploring for a little for any high quality articles or blog posts in this kind of house . Exploring in Yahoo I finally stumbled upon this website. Studying this information So i am happy to convey that I have a very good uncanny feeling I came upon just what I needed. I so much indisputably will make sure to do not put out of your mind this website and provides it a look regularly.

  73. After research a couple of of the blog posts in your website now, and I really like your approach of blogging. I bookmarked it to my bookmark website listing and will probably be checking back soon. Pls check out my web site as nicely and let me know what you think.

  74. I simply desired to thank you so much once more. I’m not certain the things I could possibly have done without those information shared by you concerning that subject matter. It absolutely was the intimidating condition in my circumstances, however , taking a look at your specialized mode you resolved that took me to leap for gladness. I’m just happy for the guidance and in addition expect you are aware of a powerful job you happen to be accomplishing instructing most people through the use of your web blog. Probably you have never encountered all of us.

  75. hey there and thank you on your information – I’ve definitely picked up anything new from proper here. I did however experience a few technical issues the usage of this website, as I skilled to reload the website many times prior to I may get it to load correctly. I had been puzzling over in case your web host is OK? Now not that I am complaining, however slow loading cases instances will often impact your placement in google and could harm your quality rating if advertising and ***********|advertising|advertising|advertising and *********** with Adwords. Well I am including this RSS to my e-mail and could look out for much more of your respective intriguing content. Ensure that you update this once more soon..

  76. Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your blog? My blog site is in the very same niche as yours and my users would certainly benefit from a lot of the information you present here. Please let me know if this alright with you. Thank you!

  77. Hi! I have come across a blog comment on this site (can not find the comment so will make a new one) with some enthusiasm in the Lawesome coin cryptocurrency. I am one of the developers of the Lawesome coin and I can verify that the Lawesome cryptocurrency is being finalized and will most likely be launched over the course of the upcoming week. For the time being, you can start amassing free Lawesome coins by putting up a guest blog post on https://blog.latestlawjobs.com. I am incredibly overwhelmed by the volume of interest the Lawesome coin has received. I am afraid that I can not divulge any additional details about this cutting-edge cryptocurrency right now as a result of our confidentiality and NDA arrangements with a number of other firms. Do reply to this comment if you have any queries.

  78. Hi, I think your site might be having browser compatibility issues. When I look at your blog site in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, wonderful blog!

  79. It?¦s really a great and useful piece of info. I?¦m glad that you simply shared this useful information with us. Please stay us up to date like this. Thanks for sharing.

  80. I simply could not go away your site prior to suggesting that I extremely loved the standard info an individual supply on your guests? Is gonna be back incessantly in order to check up on new posts

  81. Hey there just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Safari. I’m not sure if this is a formatting issue or something to do with web browser compatibility but I thought I’d post to let you know. The layout look great though! Hope you get the problem fixed soon. Many thanks

  82. Does your website have a contact page? I’m having problems locating it but, I’d like to send you an email. I’ve got some suggestions for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it grow over time.

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

  84. Hi, i see your Website branding can be improved

    Logo is very important for your brand, I can make you a great looking Logo for your Business.

    I have been designing for 5 years now, i can show you my previous work.

    Please reply to this email, so we can talk further on this.

    Thank you
    Edmundo Myer

  85. An impressive share, I just given this onto a colleague who was doing a little analysis on this. And he in fact bought me breakfast because I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you become expertise, would you mind updating your blog with more details? It is highly helpful for me. Big thumb up for this blog post!

  86. First of all I want to say terrific blog! I had a quick question in which I’d like to ask if you don’t mind.
    I was curious to find out how you center yourself and
    clear your mind prior to writing. I’ve had a hard time clearing my thoughts in getting my thoughts out
    there. I truly do take pleasure in writing but it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure out how to begin.
    Any suggestions or hints? Appreciate it!

  87. Hi there it’s me, I am also visiting this web page on a
    regular basis, this website is truly good and the visitors are actually sharing fastidious thoughts.

  88. Wow, superb blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your website is
    wonderful, let alone the content!

  89. Hi

    What a beautiful website you have made, nice design end dresses.
    I am going to marry soon in 2 months.
    I saw a beautiful wedding dress last week on your site,
    but I can not find the dress anymore in your shop,
    it looks like this on this site https://bit.ly/WeddingDress48732
    I hope you will sell the wedding dress again soon.
    mail me if you are going to sell it again,
    I’ll wait.

    Greetings

  90. Good day! This is my first comment here so I just wanted to give a quick shout out and say I genuinely enjoy reading through your posts. Can you suggest any other blogs/websites/forums that go over the same subjects? Thank you!

BİR CEVAP BIRAK

Please enter your comment!
Please enter your name here