Actually, I haven't tried lots of different variations, because I don't even know where to start :D We're having now the programming course in school and this have been the hardest one to me. So, I don't even know how I save information to txt file
:D
Oh, okay I have tried something like that and I think it works like how it should work. (This is a different exercise):
Oh okay, thanks! I'm noob with this website also, like with the Python :D I'll keep that in mind and don't do same mistake again.
:D
Oh, okay I have tried something like that and I think it works like how it should work. (This is a different exercise):
d = {} products = int(input("How many products you want to save?: ")) for i in range(products): name = input("Input the name of the product: ") price = input("Input the price of the product: ") d[name] = price print(d) while True: name = input("\nInput the name of the product to see its price: ") if name in d: print("The price of the product is", name, d[name]) else: print("The product doesn't exist.")
Oh okay, thanks! I'm noob with this website also, like with the Python :D I'll keep that in mind and don't do same mistake again.