473,625 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access second and another value of a key?

4 New Member
Expand|Select|Wrap|Line Numbers
  1. dicc ={ "key" : ["value1", "value2"], ...}
  2.  
How can I access the second value?

I can do :
Expand|Select|Wrap|Line Numbers
  1. for i in dicc:
  2.     print(dicc[i])
  3.  
  4. or
  5.  
  6. for i in dicc:
  7.     print(dicc.get(i))
  8.  
but it will print me both values and i need to access only first one or second one,third etc...cant use slices cooz of the error.
Aug 14 '15 #1
1 1320
Dietrich41
1 New Member
Expand|Select|Wrap|Line Numbers
  1. dicc = { "key" : ["value1", "value2"]}
  2.  
  3. for k, v in dicc.items():
  4.     print(v[1])
  5.  
Aug 14 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1370
by: Nir | last post by:
Hello All , I need to get access to another session object . It is possible ??? Thanks Nir
2
2888
by: Stoic | last post by:
I'm offering a selection of three items. One is $25, the second is $50, the third is $100. Along with selection one of the items I need to pass the quantity of the selection. Here is the code now. <tr><td><input type="radio" name="item_name" value="Reduced">Reduced</td><td><input type="radio" name="amount" value="25">$25.00ea.</td></tr> <tr><td><input type="radio" name="item_name" value="Regular">Regular</td><td><input type="radio"...
0
1191
by: B. Massey | last post by:
I'm sure this is a simple problem, but my Access is very rusty. I have inherited a somewhat non-normailized database with some existing jumbled forms. I have two tables without a defined relationship, but have two columns in common. FacilityID and FacilityName. A form has been created previously that queries a record from one table based on FacilityID and populates fields. Then in the remainder of the form a record is entered into the...
2
1009
by: Gopal Prabhakaran | last post by:
Dear All, In one solution , I have 2 webapplication, Now i want to access session value form webapplication 1 to webapplication 2. Pls help ASAP Millions of Thanx in advance.
4
8289
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str = DataBinder.Eval(MyDatalist.Items(count).DataItem, "customerId") but it doesn't work.
5
2611
by: Peter Olcott | last post by:
I created an object that requires access to another objects data, yet have found no good way to pass this data as a parameter because the member function that requires this data must be a binary predicate for std::sort. The only way that I got it to work so far is to make the other object global. Are there any better ways than this? Thanks, Peter Olcott
6
1653
by: Michael | last post by:
How can I get X (or another value) from this string "asdfsadfX", basically i want to get what ever is in between the tags and place them in a variable called $www , can anyone help?
1
1493
by: TeknoShock | last post by:
I am trying to use an if then in javascript to change one value based on what a user inputs for another value. It is not working correctly. Here is the relevant code: --------------------------- <script language="javascript" > function decideWhoToMailTo(dform) { if (document.dform.ru.value == "122") { document.dform.param_pie = "me@mycompany.org"; } else if (document.dform.ru.value == "144") {
5
4371
by: konaravikumar | last post by:
writing a query to get the second highest value in atable by using select statement
0
8253
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1499
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.