So I understand that classes are basically blueprints for when you are coding, but the thing I don't understand is the difference they have from functions. Since for both of them you can assign variables and use different variables inside of them. And in order for both of them to work you have to use exampleclass() or examplefunction() for it to execute. Also as well you can execute a function inside a function or define a function within a functions and with a class you can execute or define a class inside a class.
example class:
class bank(object):
def __init__(self, acc_num, acc_name, acc_DOB):
self.acc_num = acc_num
self.acc_name = acc_name
self.acc_DOB = acc_DOB
or example function:
def bank(num, name, DOB):
acc_num = num
acc_name = name
acc_DOB = DOB
*The two example I have given may not be perfectly correct but I was doing off the top of my head.
The two examples I have given look exactly the same but and look like they do the same thing so what is the difference.
bwould be after runningb = bank(1, 'bob', '1980-05-04')with the class, or with the function? Can you do anything useful with the function?__init___has too many underscores.)