(Jun-06-2020, 08:35 PM)yasser Wrote: my question how can i append my dictionary from inputs coming from :idphone?Here a smaller version with some fixes and a shortcut to making the dictionary

class Phone: def __init__(self, firstname, mobile): self.firstname = firstname self.mobile = mobile def __str__(self): return f"First Name: {self.firstname}\nMobile No: {self.mobile}"Usage test:
>>> id_phone = Phone('Kent', 1122334455) >>> id_phone.mobile 1122334455 >>> >>> print(id_phone) First Name: Kent Mobile No: 1122334455 >>> >>> phonenote = id_phone.__dict__ >>> phonenote {'firstname': 'Kent', 'mobile': 1122334455} >>> phonenote['mobile'] 1122334455