Last login: Thu Sep 3 06:29:18 on ttys002 The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. (base) MAC:Thu Sep 03:10:39:20202021> python Python 3.7.4 (default, Aug 13 2019, 15:17:50) [Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> s = 'single quoted string' >>> s 'single quoted string' >>> t = "double quoted string" >>> u = "unbalanced string' File "", line 1 u = "unbalanced string' ^ SyntaxError: EOL while scanning string literal >>> s 'single quoted string' >>> s[1] 'i' >>> s 'single quoted string' >>> s[2] 'n' >>> s[0] 's' >>> s[:3' File "", line 1 s[:3' ^ SyntaxError: EOL while scanning string literal >>> s[:3] 'sin' >>> s 'single quoted string' >>> s = "abcdef" >>> s[:3] 'abc' >>> s[3:] 'def' >>> s[1:3] 'bc' >>> s[::2] 'ace' >>> s.capitalize() 'Abcdef' >>> s 'abcdef' >>> ##python strings are immutable. ... >>> t = s.capitalize() >>> t 'Abcdef' >>> s = s.capitalize() >>> s 'Abcdef' >>> s = "abcdef" >>> s.upper() 'ABCDEF' >>> s = s.upper() >>> s 'ABCDEF' >>> s.lower() 'abcdef' >>> s.swapcase() 'abcdef' >>> s 'ABCDEF' >>> s.swapcase() 'abcdef' >>> s.endswith("f File "", line 1 s.endswith("f ^ SyntaxError: EOL while scanning string literal >>> s 'ABCDEF' >>> s.endswith("F") True >>> s.endswith("EF") True >>> s.endswith("DEF") True >>> s.beginswith("ABC") Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'beginswith' >>> s.startswith("ABC") True >>> s.find("q") -1 >>> s 'ABCDEF' >>> s.find("B") 1 >>> test = "abracadabra" >>> test.find("b") 1 >>> test.find("b", 2) 8 >>> test 'abracadabra' >>> test.rfind("b") 8 >>> test.isalnum() True >>> screwy = "#@%$asdfs" >>> screwy.isalnum() False >>> s = "233434" >>> s.isdigit() True >>> q = int(s) >>> q 233434 >>> s = "space cadet" >>> s.isidentifier() False >>> s.isprintable() True >>> s = " cows + File "", line 1 s = " cows + ^ SyntaxError: EOL while scanning string literal >>> s = " cows " >>> s.strip() 'cows' >>> s.lstrip() 'cows ' >>> s.rstrip() ' cows' >>> s ' cows ' >>> s = "This is a test of your patience" [Restored Sep 3, 2020 at 11:08:12 AM] Last login: Thu Sep 3 11:08:11 on ttys002 The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. (base) MAC:Thu Sep 03:11:08:20202021>