Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python char at

>>> s = "python"
>>> s[3]
'h'
>>> s[6]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: string index out of range
>>> s[0]
'p'
>>> s[-1]
'n'
>>> s[-6]
'p'
>>> s[-7]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: string index out of range
>>> 
Comment

char in python

there is no dataype as char in python
Comment

PREVIOUS NEXT
Code Example
Python :: fibonacci series in python 
Python :: access to specific column array numpy 
Python :: ImportError: No module named _bootlocale 
Python :: get files in directory 
Python :: how to remove a list of numbers from a list in python 
Python :: if else in python 
Python :: shuffle text lines python 
Python :: Customize color stacked bar chart matplotlib 
Python :: python check None 
Python :: python compare each item of one list 
Python :: super title python 
Python :: get particular columns from dataframe 
Python :: how to show installed tkinter fonts 
Python :: if else pandas dataframe 
Python :: how to print in python 
Python :: dataframe summarize how many in each column 
Python :: requirement.txt for python 
Python :: python IndexError: list assignment index out of range 
Python :: tqdm 2 progress bars 
Python :: pandas make dataframe from few colums 
Python :: Python Changing a Tuple 
Python :: how to set the size of a kivy window bigger than screen 
Python :: numpy create empty array 
Python :: python dictionary key in range 
Python :: python outlook 
Python :: concatenate list 
Python :: boolean in python 
Python :: django.db.utils.IntegrityError: 
Python :: python string to list of chars 
Python :: convert price to float pandas 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =