tacchini's manual

自分用のマニュアルを作成します。

python string

写経します

文字列 - Python入門から応用までの学習サイト

# -*- coding: utf-8 -*-
print 'tacchini-blog'
print "tacchini-blog"
print """tacchini-blog1
tacchini-blog2
tacchini-blog3"""
print """
tacchini-blog-a
tacchini-blog-b
tacchini-blog-c
"""
print 'tacchini' + '-' + 'blog'
test_str = 'tacchini'
test_str += '-'
test_str += 'blog'
print test_str
print 'tacchini-' * 3
print str(100) + '円'
print 'tacchini-blog'.replace('-', '#')
print 'tacchini-blog'.split('-')
print '108'.rjust(10, '0')
print '108'.rjust(10, ' ')
print '108'.ljust(10, '0')
print '108'.ljust(10, '+')
print '108'.zfill(10)
print '108'.zfill(3)
print '108'.zfill(-10)
print 'tacchini-blog'.startswith('tacchini-blog')
print 'tacchini-blog'.startswith('blog')
print 'c' in 'tacchini-blog'
print 'd' in 'tacchini-blog'
print 'Tacchini-Blog'.upper()
print 'Tacchini-Blog'.lower()
print '-' * 30
print '          tacchini-blog'
print '          tacchini-blog'.lstrip()
print 'tacchini-blog'.lstrip('tacchini')
print '-' * 30
print 'tacchini-blog.com          /'
print 'tacchini-blog.com          '.rstrip() + '/'
print 'tacchini-blog.com'.rstrip('com')