Is there another way to solve this problem?
hey guys, I defined an object under a class and gave different data types as arguments. No doubt code gave the error. class buffalo: def __init__(self, weight, length): self.weight = weight self.lenght = length bholi = buffalo(100kg, 100m) print(bholi.weight) Now one way to solve this problem is I should write 100kg and 100m= "100kg" and "100m" (whole as string) bholi = buffalo("100kg","100m") but if I want to change argument in some order. for ex weight of the animal now is 100kg but after one year lets take ii as 100+5 kg and I want to do this automatically with the help of the program or by manually (user input). In that condition, I have to split that string("100kg") into two parts ("100"+"kg") then I have to convert 100 into 'int' then again convert 100 into a string and get the answer. the process seems lengthy so I am looking for an alternative to perform the same task.