Python> dictionary> values ()> Get All Values by Using values ()

@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (No. 1657 / 12833)

Get All Values by Using values()

I've tried.

http://ideone.com/LATO2j

mydic = {'7of9' : 'borg', 'Chakotay' : 'human', 'Janeway' : 'human'}
print(mydic.values())

Operating environment


['human', 'borg', 'human']

It can be seen from the above that the value obtained by values () is different from the order at the time of setting, probably because the order of the pair to be set is not retained in the case of dictionary.

http://ideone.com/DRpIPQ

mydic = {'a' : 'zun', 'b' : 'zun', 'c': 'zun', 'd' : 'doko', 'e' : 'zun' }
print(mydic.values())
print('KIYOSHI!')

result


Success	time: 0.01 memory: 23352 signal:0
['zun', 'zun', 'zun', 'zun', 'doko']
KIYOSHI!

Recommended Posts

Python> dictionary> values ()> Get All Values by Using values ()
[Python] Get all comments using Youtube Data API
Python> dictionary> get ()> optional value
How to get all the keys and values in the dictionary
Expansion by argument of python dictionary
OS determination by Makefile using Python
Python dictionary
[Python] dictionary
Python dictionary
Get property information by scraping with python
All Python arguments are passed by reference
Get Suica balance in Python (using libpafe)
Get tweets containing keywords using Python Tweepy
Get Youtube data in Python using Youtube Data API
[Python] Progress display by progress bar using tqdm
[Python] Memo dictionary
Python: Tips-Swap values
[Python] Dictionary (hash)
Get multiple maximum keys in Python dictionary type
Python basics: dictionary
Get image URL using Flickr API in Python
Start using Python
Get note information using Evernote SDK for Python 3
Refined search for Pokemon race values using Python
Pass values between pages using Python 3.5 cgi module
I tried using the Datetime module by Python
How to get dictionary type elements of Python 2.7
Get coordinate values and keyboard input values by clicking on the python / matplotlib diagram
Scraping using Python
Get the SQL executed by dataset (Python OR mapper)
Get environment variables in Python, otherwise set default values
Get LEAD data using Marketo's REST API in Python
[Python] Get insight data using Google My Business API
[Python] Get element by specifying name attribute in BeautifulSoup
Get and automate ASP Datepicker control using Python and Selenium
Get files from Linux using paramiko and scp [Python]
Speech file recognition by Google Speech API v2 using Python
[Python] Get the number of views of all posted articles
Create a dictionary by searching the table using sqlalchemy
Primality test by Python
[Python] Get environment variables
Python Basic Course (7 Dictionary)
Operate Redmine using Python Redmine
Visualization memo by Python
Communication processing by Python
Fibonacci sequence using Python
Data analysis using Python 0
[Python] Get Qiita trends
Data cleaning using Python
Python3 List / dictionary memo
Using Python #external packages
WiringPi-SPI communication using Python
Python Dictionary Beginner's Guide
Swapping values in Python
Age calculation using python
[Python3] Get date diff
Get date in Python
Beamformer response by python
Get date with python
Search Twitter using Python
Name identification using python