class Person:
def __init__(self, name):
self.name = name
def get_contact_info(self):
return {
'name': self.name,
'email': 'peter@pjot.se',
'phone': '+46734241486',
}
def get_skills(self):
return ['linux', 'python', 'javascript', 'sql']
me = Person('Peter Bergström')
type Person struct {
Name string
}
type ContactInfo struct {
Name string
Email string
Phone string
}
func (p *Person) GetContactInfo() ContactInfo {
return ContactInfo{
p.Name,
"peter@pjot.se",
"+46734241486",
}
}
func (p *Person) GetSkills() []string {
return []string{
"linux", "golang", "python", "sql",
}
}
func main() {
person := Person{"Peter Bergström"}
fmt.Println(person.GetSkills())
}
var Person = function (name)
{
this.name = name;
};
Person.prototype.getContactInfo = function ()
{
return {
name : this.name,
email : 'peter@pjot.se',
phone : '+46734241486'
};
};
Person.prototype.getSkills = function ()
{
return ['linux', 'python', 'javascript', 'sql'];
};
var me = new Person('Peter Bergström');
create table persons (
id int(8) auto_increment primary key,
name varchar(255),
email varchar(255),
phone varchar(255)
);
insert into persons (
name,
email,
phone
) values (
'Peter Bergström',
'peter@pjot.se',
'+46734241486'
);