DEV Community

Cover image for Ms. Class Python I (...)
Natália Catunda
Natália Catunda

Posted on

1

Ms. Class Python I (...)

Now we talk about the second part of this universe.
let's go!
At first post, I put one attribute outside a method,'Kind'.
it's important if you want to work on one kind of class, right? (what you think?)
Today I create a Class Person...

class Person:
    def __init__(self,name,age):
        self.name = name
        self.age = age

n = Person("Natália Catunda","27 anos")
p = Person("Paulo Andrande","28 anos")
print(p.name, p.age)
Enter fullscreen mode Exit fullscreen mode

This method doesn't have any attributes outside.
just one important characteristic that code is...
the way that I declare these 2 attributes (name and age).
It's a simple representation of class very important and good to beginners like me! ;)
Thanks for reading this little python pill,
and keep learning!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay