473,499 Members | 1,678 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 1316
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
1347
by: Nir | last post by:
Hello All , I need to get access to another session object . It is possible ??? Thanks Nir
2
2877
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....
0
1179
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...
2
1000
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
8277
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 =...
5
2601
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...
6
1636
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
1478
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: ---------------------------...
5
4353
by: konaravikumar | last post by:
writing a query to get the second highest value in atable by using select statement
0
7134
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,...
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6905
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...
1
4921
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...
0
4609
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...
0
3108
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...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
311
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...

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.