Messaging a Python Object

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024
  • Looks at how a die (dice) can be implemented in a Python program and shows the importance of messaging Python objects.

ความคิดเห็น • 20

  • @Mrjarnould
    @Mrjarnould 8 ปีที่แล้ว +6

    Just finished watching all your videos on Classes and OOP - they're great! Looking forward to seeing more OOP tutorials :)

    • @Mrjarnould
      @Mrjarnould 8 ปีที่แล้ว +3

      Just donated!

    • @johnphilipjones
      @johnphilipjones  8 ปีที่แล้ว +3

      More on the way in the coming weeks. Thank you for the positive comments.
      Best wishes
      Phil

  • @alamgirhossien4004
    @alamgirhossien4004 ปีที่แล้ว +1

    Great teacher.

  • @cristofapeeking6899
    @cristofapeeking6899 6 ปีที่แล้ว +1

    Excellent. I wish all tutorials were as explicit as this.

  • @SundaraPaalRT
    @SundaraPaalRT 8 ปีที่แล้ว +1

    Thanks, Phil. Awesome tutorials on Python. You saved me at-least couple of weeks of reading.
    Thanks again.

  • @stavan2003
    @stavan2003 7 ปีที่แล้ว +1

    Thanks a lot Phil....your series helps me look at things differently(and correctly) in python now...!!!

  • @johnpaulpagelerjr.5188
    @johnpaulpagelerjr.5188 8 ปีที่แล้ว +1

    Cheers Phil,
    Just finished your series on Python Programming... I thoroughly enjoyed your teaching style. I look forward to your next video project. Thank you for your efforts, John

    • @johnphilipjones
      @johnphilipjones  8 ปีที่แล้ว +1

      Thank you for your positive comments. I will be returning to make more Python videos over the coming months. The series will take around another two years to complete. If you join the community (link below) you will get an update when I upload my next videos or follow me on twitter (link below) as I tweet every time I upload a video.
      plus.google.com/communities/108318057967049881054?partnerid=ogpy0
      twitter.com/jpjVideoTuts
      Best wishes
      Phil
      (John Philip Jones)

    • @ericlala
      @ericlala 8 ปีที่แล้ว +1

      Hi Phil, i just started your series on python and am enjoying your teaching style. If you are by chance taking suggestions on new videos, would you be able to get into numpy and pandas? Thanks

  • @hippy6669
    @hippy6669 8 ปีที่แล้ว +1

    Thank you for all your videos. They help me a lot.

  • @abdelkrimbari6526
    @abdelkrimbari6526 8 ปีที่แล้ว +4

    Thanks, good explained

  • @Lennardish
    @Lennardish 3 ปีที่แล้ว +1

    Lovely to watch and I learned from you to make an amendment. I am standing on the shoulders of a Giant :)))) THANK YOU.
    I am also thinking now of forming a list and calculating sum and average of that list .
    import random
    i = 1
    class Die:
    def __init__(self):
    self.side = 0
    def throw(self):
    self.side = random.randint(1, 45)
    def get_value(self):
    return self.side
    my_die = Die()
    while i

  • @zeeshanakram8751
    @zeeshanakram8751 6 ปีที่แล้ว +1

    Sir! there is a question:
    is "self.side" mutable ? Question raised because the value of "self.side" changed from "0" to "6" without creating another object.

    • @johnphilipjones
      @johnphilipjones  6 ปีที่แล้ว +4

      self.side is a property of the class and can be changed. However, the type of the number stored in this property is an integer. An integer is immutable and cannot be changed. So when you generate a number between 1 and 6 a different integer (i.e. object) is stored in the property.
      Best wishes
      Phil

  • @mafadaf5123
    @mafadaf5123 8 ปีที่แล้ว

    Great vid JPJ!

  • @VamshiKanthKota
    @VamshiKanthKota 7 ปีที่แล้ว

    Eagerly waiting for more if you have any planned...

  • @baaley1
    @baaley1 8 ปีที่แล้ว +1

    thanks

  • @zakirhossain7413
    @zakirhossain7413 ปีที่แล้ว

    So attribute is the only thing has the __init__ property? Not the methods/behaviors?

    • @johnphilipjones
      @johnphilipjones  ปีที่แล้ว

      I am unclear on what you are asking here. Please contact me via the form at the link below and hopefully I will be able to help.
      www.johnphilipjones.com/contact.html
      Please ensure that you enter your email correctly.
      Best wishes Phil