You could use a generator to only grab ages.
# Get a dictionary
myList = [{'age':x} for x in range(1,10)]
# Enumerate ages
for i, age in enumerate(d['age'] for d in myList):
print i,age
And, yeah, don’t use semicolons.
More Related Contents:
- Python – how to restore original string after replace? [closed]
- How to sleep Selenium WebDriver in Python for milliseconds
- Escaping regex string
- Efficiently Using Multiple Numpy Slices for Random Image Cropping
- Why are packages installed rather than just linked to a specific environment?
- Does PyGame do 3d?
- How to stop Flask from initialising twice in Debug Mode? [duplicate]
- Regex matching between two strings?
- Extract elements of list at odd positions
- The smtplib.server.sendmail function in python raises UnicodeEncodeError: ‘ascii’ codec can’t encode character
- Decorator execution order
- Replace all text between 2 strings python
- Django: Adding “NULLS LAST” to query
- Python Pandas replicate rows in dataframe
- Namespaces with Module Imports
- Why does csvwriter.writerow() put a comma after each character?
- “zsh: illegal hardware instruction python” when installing Tensorflow on macbook pro M1 [duplicate]
- How do I specify a range of unicode characters
- How to remove read-only attrib directory with Python in Windows?
- python pig latin converter
- How can I access variables from the caller, even if it isn’t an enclosing scope (i.e., implement dynamic scoping)?
- Face detection throws error: !empty() in function cv::CascadeClassifier::detectMultiScale
- Is there a build-in function to do skeletonization?
- Calling a hook function every time an Exception is raised
- Convert all strings in a list to integers
- ValueError: Shape of passed values is (1, 6), indices imply (6, 6)
- Plotting implicit equations in 3d
- How to get list of all variables in jinja 2 templates
- Numpy array broadcasting rules
- Drop row in pandas dataframe if any value in the row equals zero