4.3 Write python code
Create new file and name it as sample.py
and start writing python code.
Please note sample.py
and falke8
configuration files
stored on same directory level.
Source code sample.py
:
# Source code sample.py:
import os
class AddTen:
"""Class for add ten to a given number"""
def __init__(self, user_input):
self.user_input = user_input
self.new_varaible = 10
d = {}
def add_ten(self):
"""Init for calss."""
try:
return self.newvaraible + self.user_input
except:
print("Unknown Errror")
return None