Are these lines indented properly?
for ml in key:
value = myDict.get(ml, "not found");
re = [];
re.append(value)
I think you want it to do this:
re = []
for ml in key:
value = myDict.get(ml, "not found")
re.append(value)
return '-'.join(re)
BTW no semicolons used in Python.
Related Contents:
- Get statistics for each group (such as count, mean, etc) using pandas GroupBy?
- Transpose list of lists
- Renaming column names in Pandas
- Using python’s eval() vs. ast.literal_eval()
- Sorting arrays in NumPy by column
- How to get attribute of element from Selenium?
- How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?
- How to reliably open a file in the same directory as the currently running script
- range() for floats
- List on python appending always the same value [duplicate]
- PyQt showing video stream from opencv
- Seeing escape characters when pressing the arrow keys in python shell
- Plotting 3D Polygons in python-matplotlib
- How to stop Flask from initialising twice in Debug Mode? [duplicate]
- Generate all permutations of a list without adjacent equal elements
- mongodb: insert if not exists
- Inline labels in Matplotlib
- Python Binomial Coefficient
- python location on mac osx
- Download and save PDF file with Python requests module
- Difference between pygame.display.update and pygame.display.flip
- How do I clear all variables in the middle of a Python script?
- NumPy version of “Exponential weighted moving average”, equivalent to pandas.ewm().mean()
- Why does Python use ‘magic methods’?
- How to apply piecewise linear fit in Python?
- Matplotlib DateFormatter for axis label not working
- How to access the type arguments of typing.Generic?
- How to avoid infinite recursion with super()?
- how to handle an asymptote/discontinuity with Matplotlib
- When calling super() in a derived class, can I pass in self.__class__? [duplicate]
- Python: Get HTTP headers from urllib2.urlopen call?
- Python – can I detect unicode string language code?
- How to set up a PostgreSQL database in Django
- Python send POST with header
- Read file content from S3 bucket with boto3
- Unbounded range()
- Python 3: How to specify stdin encoding
- How to count digits, letters, spaces for a string in Python?
- Automatically document all modules recursively with Sphinx autodoc
- How do you do a simple “chmod +x” from within python?
- Type hinting / annotation (PEP 484) for numpy.ndarray
- Weird closure behavior in python
- Name is not defined in a list comprehension with multiple loops
- How do I get current URL in Selenium Webdriver 2 Python?
- Difference between defining typing.Dict and dict?
- Convert tab-delimited txt file into a csv file using Python
- “Boolean” operations in Python (ie: the and/or operators)
- How to plot multiple dataframes to the same plot axes
- Getting all visible text from a webpage using Selenium
- How to make a proper server tick?