Answers for "python character at"

5

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
>>>
Posted by: Guest on March-31-2020
2

character in python

chr()	Converts an integer to a character
ord()	Converts a character to an integer
Posted by: Guest on May-24-2021
0

char in python

there is no dataype as char in python
Posted by: Guest on March-26-2021

Code answers related to "python character at"

Python Answers by Framework

Browse Popular Code Answers by Language