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

Python Programming Tutorial – 30 – init
by
Tags:
Comments
24 responses to “Python Programming Tutorial – 30 – init”
-
Not cool man. -Subscribed!
-
Another great tutorial!
-
british wannabe init
-
fuckin tuna xD
-
I like your video but could you activate the automatic subtitle for this video? thanks!
-
Is init like constructor ??
-
Excellent explanation as always.
-
hi, you could call it energylevel (for exemeple)in place of init and it would work, isn t it?
-
7 dislikes ??? welp… 7 Jasons spotted*
-
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.
-
dude where is the 1080p version ..
-
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 = luckdef 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 = 100def 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() -
For all you Bioshock fans out there, I made this class function for you. ๐
class Enemy:
def _init_(self, x):
self.energy = xdef 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.") -
subtitle, please !!
-
Hi.Bucky, can u give more detail about "self"?
-
clean,simple,tight,I don't know what to call this ,definitely the best Python Tutorial I have ever seen!
-
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
-
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 parametersProcess finished with exit code 1
-
so init is like a constructor in C++ ?
-
so sweet ! ๐ Love it ! ๐ thanks a lot! ๐
-
WOW I finally got it after a bunch of confusing tutorials!
THANK YOU! -
ุงูู ุณูุงู ุฉ ูููู
-
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.
-
Jason is evil :))
Leave a Reply