dictionary tag

93 questions


1 answers
109 views
0
Please give me a simple Python algorithm question!

list = [{'id':'hello'','name':'kim','address':'seoul'},{'id:'hello','name':'choi','address':'busan'}]If there's a dictionary on the list,If the id value is the sameI want to combine the name and addre...


2 answers
93 views
0
(Beginner) I don't know how to declare and enter a list in Python Dictionary "T"

Finally, the desired dictionary form is {'Code 1' : [Code 1 name, 1 or 0], 'Code 2' : [Code 2 name, 1 or 0], ...} You want to enter 1 or 0 in the list [1] element with a separate actionI can't do this...

2 years ago

1 answers
126 views
0
Python List, Dictionary Approach Question

x = {'a': ['aaa', 'bbb'], 'b': ['aaa', 'ccc'], 'c': ['bbb', 'ccc']}y = []for i in x['a']: if i in x['c']: y.append(i) print(y)If you write it like this, only [bbb] comes outI want to print 'a' and '...

2 years ago

3 answers
86 views
0
I'd like to combine the dictionaries if the value value of one key is the same in several dictionaries.

[{'a': 567.0, 'inventory_code': 'SA100426'}, {'a': 1038.94, 'inventory_code': 'SA100426'}]In these dictionaries on the list,If the value of the inventory code is the same, I would like to combine the ...

2 years ago

2 answers
70 views
0
To find the value with a part of the key in the dictionary, ㅠㅠ

Like a captured image If the key includes the letter 'third grade', I want to print out the phone numbers of Hong Gil-dong and Hong Gil-soon.What is there to do?! Have a nice day Thank you!

2 years ago

1 answers
107 views
0
A very simple 20-line country - a dictionary error in the search for the capital.

// Enter code here#A function that returns a city and country name when you type a city namedef city_country(): city = input (Please enter a city name :) city_country = {Seoul : Korea, Athens : Greece...

2 years ago

1 answers
131 views
0
Python Dictionary Questions

Hi, everyone.I have a question regarding Python dictionary function.We created a function that matches the following largest score - person names.I think it's recognized as 2,1 if the score is 20,19.I...

2 years ago

2 answers
142 views
0
Please help me to find the same value in the dictionary in the Python two lists and make one list

ex_list_1 = [{name:kim, age:35, height:185}, {name:Lee, age:15, height:165}] ex_list_2 = [{first_name:kim, nickname:kkk}]When there are two lists of this type, I would like to combine the dict() of ex...


2 answers
74 views
0
In dictionary, key contains certain characters

How should I write a code that outputs a key containing a specific character out of all keys in the dictionary and outputs all data types included in the value?

2 years ago

1 answers
161 views
0
Can I put two Python lists in the dictionary's key and value values?

Can I put two lists in one dictionary as keys and values?a=[Apple, Banana, Pineapple]b=[1,2,3]When dic={'Apple':1, 'Banana':2, 'Pineapple':3}Can you put it in order like this?

« - 3 - »

© 2024 OneMinuteCode. All rights reserved.