Python 3 Tutorial: 19 - Classes

preview_player
Показать описание
This tutorial begins the journey into object-oriented programming.
Рекомендации по теме
Комментарии
Автор

These are excellent videos. Keep up the good work.

frosp
Автор

Very Useful for new Py Developers indeed.Thanks

MyMGZSEVExperience
Автор

ahhhh ive been waiting so long for this. Ive purposefuly been ignoring other tutorials on classes and objects just so i can watch you do it. you do it so much better.

jillybooty
Автор

Cool, dude. Honestly I've never get so long till here. Everytime I gave up earlier or had something else to do so.. But I can actually do something useful now. Thanks for it

hrnekbezucha
Автор

Here's the full code:

class Student:
def __init__(self, name):
self.name = name
self.attend = 0
self.grades = []
print("My name is {0}".format(self.name))
def addGrade(self, grade):
self.grades.append(grade)
def attendDay(self):
self.attend += 1
def getAverage(self):
return sum(self.grades) / len(self.grades)

Jovahkiin
Автор

It gets mad at me too. Awesome tutorial man, keep it up!

TheLordsForce
Автор

This was very clear and easy to understand. Thank you!

olddirtyspatula
Автор

Thank you very much!
Just a question: Whats your Recording program

likestomeasurestuff
Автор

Hey Nice tutorial!

I used to stutter the same way do. Try breathing a little while you speak, and see how easy it becomes to churn out long sentences!

Cheers.

saideepakb
Автор

Thank you so much! This explained everything so well!!!!

MichaelJfanreal
Автор

keep getting this after entering my student 1 variable: TypeError: this constructor takes no arguments. Is there anyway to fix this?

InflamedBull
Автор

Very good video! Having a lot of trouble understanding classes, but I think it just became a bit more manageable :-) THANK YOU

DoctorUltraviolence
Автор

Great video man, you have such class! ;)
Thanks a bunch!

barack.obama.official
Автор

I have watched your T1 to T19 so far. I thinks you may taken some time off somewhere in the series. I think if you ever do it again, you should take some time in the begining of each Tutorial to explain what you are going to do. Starting and ending result summery, the proceed to do the Tutorial. Please note that I have really enjoyed your Tutorials.

alexremington
Автор

great tutorials, you should keep making them! ;)

OlavLjosland
Автор

Dude, great video!
Loved it
You should get payed

mrolimari
Автор

alot of people dont seem to know this, so just to make it clear, "self" has no special meaning for python, you can put "banana" there instead. When a class is called, the object is passed as the first argument for all methods. It is simply a convention to use "self" as that first argument.

tyinykiller
Автор

Why do you use name as a parameter in __init__ but not attend and grades? How do you know if you need to have method variables as parameters? Do we need parameters at all since it seems we can use attend in the same way as name and get the results we want?

gloriaramlal
Автор

How does the formatting at 4:50 work? Why is the {0} in "Hi! My name is {0}" replaced with the student's name?

tomkitchen
Автор

is there a way that i can print or view all of the contents of a class loke the student class. for example if i had the names mike, paul, mart is there a code that i can use to see all of the names. thanks

epicnessrising