Skip to content

Commit

Permalink
python string istitle() function examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Dec 19, 2018
1 parent 00da340 commit 47e30e2
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Python-3/basic_examples/strings/string_istitle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
s = 'A Big Cat'
print(s.istitle())

s = 'A BIG Cat'
print(s.istitle())

s = 'A big Cat'
print(s.istitle())

s = 'a big cat'
print(s.istitle())

s = 'A'
print(s.istitle())

s = ''
print(s.istitle())

# special characters
s = 'Â Ɓig Ȼat'
print(s.istitle())


import unicodedata

count = 0
for codepoint in range(2 ** 16):
ch = chr(codepoint)
if ch.istitle():
print(u'{:04x}: {} ({})'.format(codepoint, ch, unicodedata.name(ch, 'UNNAMED')))
count = count + 1
print(f'Total Number of Space Unicode Characters = {count}')


0 comments on commit 47e30e2

Please sign in to comment.