Python Intermediate Tutorial 2 - Classes

preview_player
Показать описание
This is a tutorial that covers what a class is, how to make one in python and talks about attributes and methods. All Links and Slides will be in the description. Subscribe for more cool stuff!

If you like what you see be sure to subscribe and thumbs up!
Рекомендации по теме
Комментарии
Автор

Why do we need to do *str* at me.number?

maarten
Автор

I'm amazed at the quality of vids and amount of time/info you've put into this. It is truly appreciated. Keep up the good work. Thank you.

IboHuasca
Автор

Hi draps, good tutorial as always :)
but don't we need to learn about the constructor in python, or it's not important for now. ? in my opinion making objects in python is easier than java, i don't know why but maybe because i hate java <<< my first language, i didn't even finish it !!!
keep it up !!! 

sbapungi
Автор

What does the "self.blablabla" in the code mean? That is uses itself? It's a thing in the function that you don't use? The function is "def add(self, name):" and when you call it you only give it one variable "list.add("Draps")" ...how does this work? Shouldn't there be something in front of Draps?

EDIT: Oh you explain it in the next video :) I'll watch that now :D

TheBertjeT
Автор

Okay in your version you didn't have to do __init__ as the constructor nor did you create an attribute that was allocated to self. You version has to be newer cause I have to put the setters and getters

jenniferoviawe
Автор

Would the use of classes be what is used to code names and damage also upgrades for weapons in game

masterfall
Автор

how did you make the class. i saw that you did vim myclass.python, I did that but it said that vim is not a program. srry im a noob at coding i just started.

owenpurchase
Автор

you never explained the if-statement in the end...

pellepellson
Автор

Overall, very excellent--thanks man! Only suggestion I'd make is maybe not so much read the slides verbatim, but talk ABOUT them? Analogies? Examples? Other than that, GOOD JOB!

minhlu
Автор

why  wont this work    
    try:
        print ("now what is the circumfrence")
        number2 = raw_input("What is the radius: ")
        diam = number2 * 2
        print "the diameter is " + diam
        circumf = math.pi * circ
        print "The circumfrance is " + circumf
    except:
        print "your number was not valid"

masterfall
Автор

Hi Draps! Thanks for these videos. They have helped me understanding comments on which I have been stuck for long. I had one query in the challenge you have given in the code. Could you please message me your email ID or any other forum on on which I can show you my code? Once again thanks a lot!

rachitprasad
visit shbcf.ru