In [1]:
print('abc' == 'abc')
In [2]:
print('abc' == 'xyz')
In [3]:
print('abc' == 'ABC')
In [4]:
print('abc' != 'xyz')
In [5]:
print('abc' != 'abc')
In [6]:
print('bbb' in 'aaa-bbb-ccc')
In [7]:
print('xxx' in 'aaa-bbb-ccc')
In [8]:
print('abc' in 'aaa-bbb-ccc')
In [9]:
print('xxx' not in 'aaa-bbb-ccc')
In [10]:
print('bbb' not in 'aaa-bbb-ccc')
In [11]:
s = 'aaa-bbb-ccc'
In [12]:
print(s.startswith('aaa'))
In [13]:
print(s.startswith('bbb'))
In [14]:
print(s.startswith(('aaa', 'bbb', 'ccc')))
In [15]:
print(s.startswith(('xxx', 'yyy', 'zzz')))
In [16]:
# print(s.startswith(['a', 'b', 'c']))
# TypeError: startswith first arg must be str or a tuple of str, not list
In [17]:
print(s.endswith('ccc'))
In [18]:
print(s.endswith('bbb'))
In [19]:
print(s.endswith(('aaa', 'bbb', 'ccc')))
In [20]:
print('a' < 'b')
In [21]:
print('aa' < 'ab')
In [22]:
print('abc' < 'abcd')
In [23]:
print(ord('a'))
In [24]:
print(ord('b'))
In [25]:
print('Z' < 'a')
In [26]:
print(ord('Z'))
In [27]:
print('あ' < 'い')
In [28]:
print(ord('あ'))
In [29]:
print(ord('い'))
In [30]:
print('ん' < 'ア')
In [31]:
print(ord('ん'))
In [32]:
print(ord('ア'))
In [33]:
print('乙' < '亜')
In [34]:
print(ord('乙'))
In [35]:
print(ord('亜'))
In [36]:
print('七' < '三')
In [37]:
print(ord('七'))
In [38]:
print(ord('三'))
In [39]:
print(sorted(['aaa', 'abc', 'Abc', 'ABC']))
In [40]:
print(sorted('一二三四五六七八九十'))
In [41]:
s1 = 'abc'
s2 = 'ABC'
In [42]:
print(s1 == s2)
In [43]:
print(s1.lower() == s2.lower())
In [44]:
s = 'Abcあいうえお'
In [45]:
print(s.lower())
In [46]:
print(s.upper())