Python Forum
Creating multidictionaries in one
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating multidictionaries in one
#1
Hey guys! So basically, how would I save a prior of a dictionary before its values are changed. And also I want the format to be like this;

{'A':None,{'R1': [5,4,2,6,4],'R2':[6,5,4,7,4],'R3':[6,2,4,7,3]
I would like to have the user input the values for r1,r2,r3 and if there is no value make it none. How would i do that?
Reply
#2
If you want to save a dictionary before modifying it, you can do it like so
my_dict = {1: "one", 2: "two"}
copy = dict(my_dict)
As for the second part of your question - what have you tried?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020