In python if i wrote
g='u'
g.upper()
The output is U. My question is: When I write the code g.upper() ,what variable a pass to the function? Secondly why (g.upper()) it works? Because I learned that the dot is use to recall the class methods,so upper() is definitly not a class method of g which is a string variable.
How ever ,How can I write a code like upper() that can be apply on integer and on out I get Interger incremented or decremente a fixed amount? I tried to do like :
def ad(a, b):
print('Sum::--', a + 8)
#ad(5, 8)
v=5
v.ad()
Please give me knowledge,because I didn't find anything on web about this things .Thanks.