Python Programming Tutorial – 30 – init

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

24 responses to “Python Programming Tutorial – 30 – init”

  1. Jason Quiveiro Avatar

    Not cool man. -Subscribed!

  2. John Harper Avatar

    Another great tutorial!

  3. Rasmus Hanson Avatar

    british wannabe init

  4. Andrea Raieta Avatar

    I like your video but could you activate the automatic subtitle for this video? thanks!

  5. devashree vidyadhar rane Avatar

    Is init like constructor ??

  6. CrazyCottageCheese Avatar

    Excellent explanation as always.

  7. salsa4u Avatar

    hi, you could call it energylevel (for exemeple)in place of init and it would work, isn t it?

  8. zenix cybercube Avatar

    7 dislikes ??? welp… 7 Jasons spotted*

  9. M. Ali Akbulut Avatar

    Can you please open the auto translate from English ?? Sometimes I miss what you say so I can't understand %100 when I dont read them.

  10. Cat Avatar

    dude where is the 1080p version ..

  11. Vitex Avatar

    class Player:
    def _init_(self, energy, health, stealth, strength, speed, stamina, composure, repair_speed, luck):
    self.energy = energy
    self.health = health
    self.stealth = stealth
    self.strength = strength
    self.speed = speed
    self.stamina = stamina
    self.composure = composure
    self.repair_speed = repair_speed
    self.luck = luck

    def getEnergy(self):
    print(self.energy)

    def getHealth(self):
    print(self.health)

    def getStealth(self):
    print(self.stealth)

    def getStrength(self):
    print(self.strength)

    def getSpeed(self):
    print(self.speed)

    def getStamina(self):
    print(self.stamina)

    def getComposure(self):
    print(self.composure)

    def getRepairSpeed(self):
    print(self.repair_speed)

    def getLuck(self):
    print(self.luck)

    class Enemy:
    def _init_(self, health, strength, speed, stamina):
    self.health = 500
    self.strength = 95
    self.speed = 75
    self.stamina = 100

    def getHealth(self):
    print(self.health)

    def getStrength(self):
    print(self.strength)

    def getSpeed(self):
    print(self.speed)

    def getStamina(self):
    print(self.strength)

    enemy = Enemy(500, 95, 75, 100)

    aj_mason = Player(100, 100, 100, 50, 45, 100, 100, 50, 20)
    adam_polomino = Player(50, 100, 20, 75, 50, 100, 95, 40, 20)
    debrah_kim = Player(50, 100, 100, 10, 40, 100, 40, 85, 20)
    jenny_myers = Player(50, 100, 100, 10, 40, 100, 90, 40, 20)

    aj_mason.getEnergy(), aj_mason.getHealth(), aj_mason.getStealth(), aj_mason.getStrength(), aj_mason.getSpeed(), aj_mason.getStamina(), aj_mason.getComposure(), aj_mason.getRepairSpeed(), aj_mason.getLuck()
    adam_polomino.getEnergy()

  12. James Niedzialek Avatar

    For all you Bioshock fans out there, I made this class function for you. ๐Ÿ™‚

    class Enemy:

    def _init_(self, x):
    self.energy = x

    def get_energy(self):
    print(self.energy)

    Andrew_Ryan = Enemy(5)
    Frank_Fontaine = Enemy(18)

    Andrew_Ryan.get_energy()
    Frank_Fontaine.get_energy()

    print("Andrew Ryan has 5 energy. What a nooblet!")
    print("Franky has 18 energy. If you ask me, that lunatic had too much Adam.")

  13. Alaa Hosny Avatar

    subtitle, please !!

  14. Xiaohong Chen Avatar

    Hi.Bucky, can u give more detail about "self"?

  15. ๆŽๅจ Avatar

    clean,simple,tight,I don't know what to call this ,definitely the best Python Tutorial I have ever seen!

  16. Nick Turner Avatar

    Hi new boston I been stuck on understanding classes for ages !!! and I have paid for material I come on here watch your video and bam ! I finally understand Amazing content dude I would pay for your series it's fantastic thank you very much for all your effort I'm sure I'm not the only one here that appreciates it

  17. Sadanand Walke Avatar

    i typed the same code still im getting an error..And it says this

    C:UsersadminAppDataLocalProgramsPythonPython36-32python.exe C:/Users/admin/PycharmProjects/untitled1/sada.py
    Traceback (most recent call last):
    File "C:/Users/admin/PycharmProjects/untitled1/sada.py", line 8, in <module>
    jason = Enemy (5)
    TypeError: object() takes no parameters

    Process finished with exit code 1

  18. P K Avatar

    so init is like a constructor in C++ ?

  19. Marcin Migacz Avatar

    so sweet ! ๐Ÿ˜€ Love it ! ๐Ÿ˜€ thanks a lot! ๐Ÿ™‚

  20. Luckster 247 Avatar

    WOW I finally got it after a bunch of confusing tutorials!
    THANK YOU!

  21. kareem kareem Avatar

    ุงู„ู ุณู„ุงู…ุฉ ู‡ู‡ู‡ู‡

  22. ShinyKid Avatar

    Found your tutorial awesome. Sometimes I can't understand people well as I'm not a native english speaker. Although my english isn't that good I could understand you pretty well, and I got with ease how a class works in python. Thank you very much for your very useful tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *