- you can iterate on characters in a string :
s = "hello"
for c in s:
print(c)
# output
# h
# e
# l
# l
# o
- To make a character to lowercase and uppercase:
c.lower()
c.upper()
- Check weather a character is a alphanumeric or not: (alphanumeric means a-z, A-Z or 0-9)
c.isalnum()
added = 'h' + 'e' + 'l' + 'l' + 'o'
print(added)
# output
# hello
# Method 1: Using string slicing
s = "hello"
reversed_s = s[::-1]
print(reversed_s) # Output: olleh
# Method 2: Using reversed() function and join()
s = "hello"
reversed_s = ''.join(reversed(s))
print(reversed_s) # Output: olleh
- There is a character code table ASCII that give each character a code