You almost had it right. The simplest way is
mylist[0][0] # get the first character from the first item in the list
but
mylist[0][:1] # get up to the first character in the first item in the list
would also work.
You want to end after the first character (character zero), not start after the first character (character zero), which is what the code in your question means.
Related Posts:
- How to convert list to string [duplicate]
- Why is it string.join(list) instead of list.join(string)?
- Why is it string.join(list) instead of list.join(string)?
- AttributeError: ‘list’ object has no attribute ‘replace’ when trying to remove character
- How to check if a string is a substring of items in a list of strings?
- AttributeError: ‘list’ object has no attribute ‘replace’ when trying to remove character
- AttributeError: ‘list’ object has no attribute ‘replace’ when trying to remove character
- How do I check if there are duplicates in a flat list?
- How to concatenate items in a list to a single string?
- Create nice column output in python
- How does str(list) work?
- What is the difference between a string and a byte string?
- Python cant convert ‘list’ object to str error [closed]
- Python – TypeError: ‘int’ object is not iterable
- TypeError: list indices must be integers or slices, not str
- Does Python have a string ‘contains’ substring method?
- IndexError: list index out of range and python
- TypeError: a bytes-like object is required, not ‘str’ when writing to a file in Python3
- Finding the index of an item in a list
- Accessing the index in ‘for’ loops?
- Best way to convert string to bytes in Python 3?
- Pythonic way to create a long multi-line string
- Does Python have a string ‘contains’ substring method?
- What does the list() function do in Python?
- TypeError: not all arguments converted during string formatting python
- Is there a short contains function for lists?
- How do I append one string to another in Python?
- appending list but error ‘NoneType’ object has no attribute ‘append’
- Random string generation with upper case letters and digits
- Check if something is (not) in a list in Python
- How to avoid “RuntimeError: dictionary changed size during iteration” error?
- How to read a text file into a string variable and strip newlines?
- How do I concatenate two lists in Python?
- How can I randomly select an item from a list?
- Fastest way to check if a value exists in a list
- How can I count the occurrences of a list item?
- TypeError: ‘list’ object cannot be interpreted as an integer
- Split a string into 2 in Python
- Best way to strip punctuation from a string
- Get list from pandas dataframe column or row?
- Finding and replacing elements in a list
- ValueError: max() arg is an empty sequence
- Remove list from list in Python
- How do I convert a list of ascii values to a string in python?
- How can I compare two lists in python and return matches
- Append integer to beginning of list in Python
- List comprehension on a nested list?
- Union of two lists in Python
- Python: Array v. List
- How can I concatenate str and int objects?
- How do I check if a list is empty?
- Convert columns to string in Pandas
- How to delete a character from a string using Python
- Remove the first character of a string
- TypeError: unsupported operand type(s) for -: ‘list’ and ‘list’
- Python Sets vs Lists
- Python return list from function
- Remove all special characters, punctuation and spaces from string
- Alphabet range in Python
- Whats the difference between ‘for x in list:’ and ‘for x in list[:]:’
- How can I splice a string?
- Pop index out of range
- Print list without brackets in a single row
- How to check if type of a variable is string?
- How to read a text file into a list or an array with Python
- Map to List error: Series object not callable
- how to create a list of lists
- Python assigning multiple variables to same value? list behavior
- How can I print variable and string on same line in Python?
- Append a tuple to a list – what’s the difference between two ways?
- Remove quotes from String in Python
- How can I check if character in a string is a letter? (Python)
- How can I remove all instances of an element from a list in Python?
- Create an empty list in Python with certain size
- What’s the difference between lists enclosed by square brackets and parentheses in Python?
- Find the nth occurrence of substring in a string
- How to convert ‘binary string’ to normal string in Python3?
- Properly formatted multiplication table
- How to get a function name as a string?
- Appending to a list gives ‘int’ object has no attribute ‘append’
- Python data structure sort list alphabetically
- Python: Converting string into decimal number
- TypeError: unsupported format string passed to list.__format__
- How to compare individual characters in two strings in Python 3
- How to create a numpy array of lists?
- How to repeat a string with spaces?
- How do I convert a string to a double in Python?
- How can I copy a Python string?
- creating a reverse method for a python list from scratch
- How to get ° character in a string in python?
- In Python, is there an elegant way to print a list in a custom format without explicit looping?
- Circular list iterator in Python
- Determine if 2 lists have the same elements, regardless of order? [duplicate]
- Mutable strings in Python
- Building a list inside a list in python
- Writing Python lists to columns in csv
- Find index of last occurrence of a substring in a string
- Python – difference between two strings
- TypeError: coercing to Unicode: need string or buffer