print('===================================================================')
print('|  String Data Type                                               |')
print('|  1. Escape code                                                 |')
print('|  2. Raw literal & Byte                                          |')
print('|  3. String Operation                                            |')
print('|  4. String Fomat Code                                           |')
print('|  5. Format Function                                             |')
print('|  6. f String Formatting                                         |')
print("===================================================================\n\n")

print('01. escape code')
print('    1) Line Feed')
print('       Test change line code\n       End Test')
print('    2) Tab: Test tab\tEnd test')
print('    3) express "\\" & "\\n"')
print('    4) express "\'"')
print('    5) express "\""')
print('    6) Carrige Return')
print('       Test CR\r       End Test')
print('    7) Horizontal Tab\t', 'Test')
print('    8) Vertical Tab\v', 'Test',end='\n\n')

print('02. Raw literal & Byte')
print(r'    1) raw literal: \n  \\  \"')
print(b'  2) Byte: \n  \\  \"', end='\n\n')

print('03. String Operation')
a, b, c = 'Donghoon' , ' loves ' , 'Sukyoung'
print('    1) %s + %s + %s = %s' % (a,b,c,a+b+c))
print('    2) %s * 3 is %s' % (a,a*3))
print('    3) The length of "%s" is %d' % (a, len(a)))
print('    4) Indexing [0]   of "%s" is %c' % (a+b+c,(a+b+c)[0]))
print('       Indexing [-0]  of "%s" is %c' % (a+b+c,(a+b+c)[-0]))
print('       Indexing [1]   of "%s" is %c' % (a+b+c,(a+b+c)[1]))
print('       Indexing [-1]  of "%s" is %c' % (a+b+c,(a+b+c)[-1]))
print('       Indexing [2]   of "%s" is %c' % (a+b+c,(a+b+c)[2]))
print('       Indexing [-2]  of "%s" is %c' % (a+b+c,(a+b+c)[-2]))
print('    5) Slicing [0:4]  of "%s" is %s' % (a+b+c,(a+b+c)[0:4]))
print('       Slicing [5:10] of "%s" is %s' % (a+b+c,(a+b+c)[5:10]))
print('       Slicing [:]    of "%s" is %s' % (a+b+c,(a+b+c)[:]))
print('       Slicing [10:]  of "%s" is %s' % (a+b+c,(a+b+c)[10:]))
print('       Slicing [:10]  of "%s" is %s' % (a+b+c,(a+b+c)[:10]))
print('       Slicing [8:-5] of "%s" is %s' % (a+b+c,(a+b+c)[8:-5]), end='\n\n')

print('04. String Format Code')
print('    1) Allignment & Blank')
print('       Right Allignment: %10s' % 'Tweedy')
print('       Left  Allignment: %-10s' % 'Tweedy')
print('    2) float')
print('       =>%0.4f' % 7.123456789)
print('       =>%10.4f' % 7.123456789, end='\n\n')

print('05. Format Function')
import math
a, b = 10, 'number'
pos = list(range(1,4))
print('    01) {1} is {0}'.format(a,b))
print('    02) {0} is {n}'.format(b, n=10))
print('    03) Left   allignment: {0:<20}'.format(b))
print('    04) Right  allignment: {0:>20}'.format(b))
print('    05) Center allignment: {0:^20}'.format(b))
print('    06) Fill blank       : {0:=^20}'.format(b))
print('    07) Fill blank       : {0:!<20}'.format(b))
print('    08) float            : {0:0.4f}'.format(7.1234567))
print('                         : {0:<10.4f}'.format(7.1234567))
print('                         : {0:>10.4f}'.format(7.1234567))
print('                         : {0:^10.4f}'.format(7.1234567))
print('    09) List formating   : {p[0]} {p[1]} {p[2]}'.format(p=pos))
print('    10) pi               : {m.pi:.3f}'.format(m=math))
print('    11) etc              : {{and}}'.format(),end='\n\n')

print('06. f String Fomating')
a , b, c = 'Tweedy' , 38 , 5.124847
print(f'    1) {a} is {b} years old.')
print(f'    3) Left   allignment: {b:<20}')
print(f'    4) Right  allignment: {b:>20}')
print(f'    5) Center allignment: {b:^20}')
print(f'    6) Fill blank       : {b:=^20}')
print(f'    7) Fill blank       : {b:!<20}')
print(f'    8) float none       : {c:0.4f}')
print(f'             Left       : {c:<10.4f}')
print(f'             Right      : {c:>10.4f}')
print(f'             Center     : {c:^10.4f}')
print(f'    9) etc              : {{and}}',end='\n\n')

print('07. count() find() index() join() upper() lower() capitalize()')
print('    lstrip() rstrip() strip() replace() split() partition()')
a, b, c = 'Donghoon' , ' loves ' , 'Sukyoung'
print('    01) count("o") in "%s" is %d' % (a+b+c, (a+b+c).count('o')))
print('    02) find("D") in "%s" is %d' % (a+b+c, (a+b+c).find('d')))
print('    03) find("x") in "%s" is     %d' % (a+b+c, (a+b+c).find('x')))
print('    04) index("n") in "%s" is %d' %  (a+b+c, (a+b+c).index('n')))
print('    05) ("!").join(["%s","%s","%s"]) is "%s"' % (a,b,c, ("!").join([a,b,c])))
print('    06) upper(%s+%s+%s) is %s' % (a,b,c,(a+b+c).upper()))
print('    07) lower(%s+%s+%s) is %s' %  (a,b,c,(a+b+c).lower()))
print('    08) capitalize(%s) is %s' % (b.strip(), b.strip().capitalize()))
print('    09) strip(%s) is (%s)' % (b,b.strip()))
print('    10) lstrip(%s) is (%s)' % (b,b.lstrip()))
print('    11) rstrip(%s) is (%s)' % (b,b.rstrip()))
print('    12) replace("o", "*",3) in "%s" is (%s)' % ((a+b+c),(a+b+c).replace("o", "*",3)))
print('    13) split(" ") in "%s" is (%s)' % ((a+b+c),(a+b+c).split(" ")))
print('    14) split("loves") in "%s" is (%s)' % ((a+b+c),(a+b+c).split("loves")))
print('    15) partiion(" ") in "%s" is (%s)' % ((a+b+c),(a+b+c).partition(" ")))

# print('''Study Machine Learning & Embedded Linux''')
# print('Tweedy\'s favorite food is protine')
# print('Life is cool\nLife is short')



