-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path9-student.py
32 lines (26 loc) · 848 Bytes
/
9-student.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3
"""Module defining the class Student"""
class Student:
"""
Class that defines properties of student.
Attributes:
first_name (str): first name of student.
last_name (int): last name of student.
age (int): age of student.
"""
def __init__(self, first_name, last_name, age):
"""Creates new instances of Student.
Args:
first_name (str): first name of student.
last_name (int): last name of student.
age (int): age of student.
"""
self.first_name = first_name
self.last_name = last_name
self.age = age
def to_json(self):
"""Retrieves a dictionary representation of a Student instance.
Returns:
dict: dictionary representation.
"""
return self.__dict__