Python Forum
update dict as per range of values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
update dict as per range of values
#3
I am not able to print like this

port range is
11~16,20~21

Quote:{'port': 11, 'customer': ['shivraj', 'patil']}
{'port': 12, 'customer': ['shivraj', 'patil']}
{'port': 13, 'customer': ['shivraj', 'patil']}
{'port': 14, 'customer': ['shivraj', 'patil']}
{'port': 15, 'customer': ['shivraj', 'patil']}
{'port': 16, 'customer': ['shivraj', 'patil']}
{'port': 20, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}

where as its printing
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}
{'port': 21, 'customer': ['shivraj', 'patil']}

conf file block as below

Quote:adsl name 1 Ashank Race PVT LTD
adsl name 2 praful
adsl name 3,24 reliance park
adsl name 5 sort & ltd
adsl name 7 kishor
adsl name 8 syed
adsl name 9 pinki
adsl name 10 Sushil
adsl name 11~16,20~21 shivraj patil
adsl name 17 urvi
adsl name 22 Ritesh Patil
adsl name 23 kankunta
adsl name 25 abh=hek
adsl name 27 Tanuja
adsl name 29 Kamal
adsl name 32 M/S Balaji
adsl name 33 M/s Balaji
adsl name 37 freeg wifi
adsl name 38 anjana
Reply


Messages In This Thread
update dict as per range of values - by anna - Sep-04-2019, 01:13 PM
RE: update dict as per range of values - by anna - Sep-05-2019, 06:24 AM
RE: update dict as per range of values - by anna - Sep-09-2019, 06:48 AM
RE: update dict as per range of values - by luoheng - Sep-09-2019, 07:37 AM
RE: update dict as per range of values - by anna - Sep-09-2019, 11:01 AM
RE: update dict as per range of values - by anna - Sep-13-2019, 04:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  dict class override: how access parent values? Andrey 1 1,673 Mar-06-2022, 10:49 PM
Last Post: deanhystad
  matplotlib x axis range goes over the set range Pedroski55 5 3,280 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  Removing nan values from a dict tomtom 8 7,201 Oct-05-2021, 06:44 PM
Last Post: tomtom
  How can I count values between range dates ? Eidrizi 2 2,499 Mar-17-2021, 01:26 PM
Last Post: Eidrizi
  How to update values in a pyarrow table? xraphael75 1 3,714 Jan-25-2021, 02:14 PM
Last Post: xraphael75
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 2,725 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  Looking for help in Parse multiple XMLs and update key node values and generate Out.. rajesh3383 0 1,895 Sep-15-2020, 01:42 PM
Last Post: rajesh3383
  Trouble with converting list , dict to int values! faryad13 7 3,809 Sep-04-2020, 06:25 AM
Last Post: faryad13
  Sort a dict in dict cherry_cherry 4 80,782 Apr-08-2020, 12:25 PM
Last Post: perfringo
  How to access specific values from a dict? t4keheart 6 3,148 Feb-05-2020, 11:34 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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