[Python] How to copy dictionary values to a class?
I wrote below code and i'm not sure how to fill the class with the dictionary values. From FileName import Phone mBrand= "" mModel="" mScreen="" mBattery="" mobile = {"brand": mBrand, "model": mModel, "screen size": mScreen, "battery capacity": mBattery} For i in mobile: mobile[i] = input("Please enter your mobile" +i) while i == sorted(mobile.values())[0]: print("Your mobile "+i+ " is " +mobile[i]) """this code does not work Phone(i) = mobile[i] """ So i confirmed everything is working fine till this step but after that how can i cast the values of mobile dictionary to below class which is on another file class Phone(): def __init__(self, brand, model, screen, size): self.brand = brand self.model = model self.screen = screen self.size = size