Python Forum
Changing Variables within Variables?
Thread Rating:
  • 4 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Variables within Variables?
#6
The key:value will never change.
I know what you mean a dictionary with more key:value can order change.

So here order change,not key:value
# 3.4
>>> d
{'hello': '1'}
>>> d1 = {'car': 5}
>>> d.update(d1)
>>> d
{'car': 5, 'hello': '1'}
Using 3.4 over,in 3.6 dict is ordered(not guaranteed yet).
# 3.6
>>> d = {'hello': 1}
>>> d1 = {'car': 5}
>>> d.update(d1)
>>> d
{'hello': 1, 'car': 5}
Reply


Messages In This Thread
Changing Variables within Variables? - by dave925 - Apr-20-2017, 05:38 AM
RE: Changing Variables within Variables? - by snippsat - Apr-20-2017, 03:11 PM
RE: Changing Variables within Variables? - by Kebap - Apr-20-2017, 04:33 PM
RE: Changing Variables within Variables? - by wavic - Apr-21-2017, 08:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Very Beginner question on simple variables Harvy 1 262 Apr-12-2024, 12:03 AM
Last Post: deanhystad
  importing variables from module 8376459 1 313 Feb-18-2024, 02:24 PM
Last Post: deanhystad
  Checking for Validity of Variables RockBlok 2 585 Dec-17-2023, 05:50 AM
Last Post: Gribouillis
  Create X Number of Variables and Assign Data RockBlok 8 1,045 Nov-14-2023, 08:46 AM
Last Post: perfringo
  mypy, type aliases and type variables tomciodev 1 755 Oct-18-2023, 10:08 AM
Last Post: Larz60+
  Unchangeable variables in a class? Calab 12 1,678 Sep-15-2023, 07:15 PM
Last Post: deanhystad
Question How create programmatically variables ? SpongeB0B 6 1,421 Aug-19-2023, 05:10 AM
Last Post: SpongeB0B
  How to store columns of a .csv in variables (when the .csv has no headers) ? hobbyist 6 1,365 Aug-18-2023, 02:06 PM
Last Post: deanhystad
  Variables in a SCPI string thomaswfirth 3 984 May-22-2023, 05:04 PM
Last Post: thomaswfirth
  Advancing Through Variables In A List knight2000 0 543 May-13-2023, 03:30 AM
Last Post: knight2000

Forum Jump:

User Panel Messages

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