Python 3.12.3 (main, Mar 23 2026, 19:04:32) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license()" for more information. >>> 21 ** 1000 165689403301923945896630669406529383547782049266718769412943572324366107141405884362973027406492002751164381926422646410785056677274811928835634231738653169431946223560706159916245548130354107504390652556527095633955889588163594007157468319904229680096176024937563063973828593671110144824254083634362081276123305945400290122846651217467760823084444757932057833285680427605409845776632646644916949940963542543639354245337114338866498647583250669034020571067509104650683085926868910895149041589840485326933616214866512672255051550347041325830553264331756800528292131207257859203708269457953949526300010313332931895114188018489474579383742175044026243061652453625987675750262116302929383365495238556514298851600873876637020193861304208149143419735692613839782690216467606927972914605295094594695364685239836447309622238294439448389823680193031574146252279303235727100029997098494320283019628976772200484255566895144337994609197763983992840700516671321373211228107101022714205764271757978212356401242403846705185979799813302667408138729577400377411725091505508726693295998138742090737114775412215656597086718224632668332851200402634721788457120084422422116472470913791279302528291415009548557155164439409993184431541926737736415760954463301271163373025516844862752293799746644457513102698424902379194758218236090971366135820001 >>> 21 ** 1010 2763679526425235186027597770050598778187428363746905442309136191652563134453043554298644030121576208906975333998648136222884592846495816762445222308239167348726800166944979295970112129579842297340853872667005893370269639855103319439321534075246830555079981854595043169464910825265980840124793981761292257452605874757657390310776599167933221975930873330962719466162059828692803542412255898667448915685684323203277471820273588861583116855398754733990566742685480403289309469692707546210874102379236146618566073721817962390331151766166289270920700751435017344584683387057207259645594620492969815664752396601352092571264555178436051121593816458429331821360710517338531102388052475061058192652282457204839574349684035092266727391393081490744372059681226844608165049577121059884586423416602582242434147131638673627044074374802437788267415061152057281474269329942581406445739832979676634746576044147167176120868031042259932826608636264233184430649514781726055001738075668752344553963420003282022645335260391126301582771602940537053220147594012202418524911703827801135977116013543280099759837901239118109165382308507510805925658876435275928322537636344299193914204574901016404154198802419866659241276692387364966912430730557072979163303328767111023808289214140567222927891893674607159951006421178133398620995939883492908233005822643705140798201 21 ** 1000.0 Traceback (most recent call last): File "/usr/lib/python3.12/idlelib/run.py", line 580, in runcode exec(code, self.locals) File "", line 1, in OverflowError: (34, 'Numerical result out of range') help(str.capitalize) Help on method_descriptor: capitalize(self, /) unbound builtins.str method Return a capitalized version of the string. More specifically, make the first character have upper case and the rest lower case. name = input('Enter your name') Enter your namemike name 'mike' upname = name.capitalize() name 'mike' upname 'Mike' help(str.endswith) Help on method_descriptor: endswith(...) unbound builtins.str method S.endswith(suffix[, start[, end]]) -> bool Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try. college = 'Skidmore College' college 'Skidmore College' if college.endswith('e'): print('yes') else: print('no') yes help(str.lower) Help on method_descriptor: lower(self, /) unbound builtins.str method Return a copy of the string converted to lowercase. college 'Skidmore College' theword = college.lower() theword 'skidmore college' college 'Skidmore College' theword2 = college.upper() theword2 'SKIDMORE COLLEGE' college 'Skidmore College' help(str.find) Help on method_descriptor: find(...) unbound builtins.str method S.find(sub[, start[, end]]) -> int Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. num = college.find('more') num 4 num = college.find('mor') num 4 num = college.find('or') num 5 num = college.find('ox') num -1 college 'Skidmore College' num = college.find('e') num 7 num = college.find(' ') ] num 8 num = college.find('') num 0 help(str.rfind) Help on method_descriptor: rfind(...) unbound builtins.str method S.rfind(sub[, start[, end]]) -> int Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. college 'Skidmore College' num = college.rfind('e') num 15 num = college.rfind('ege') num 13 num = college.find('ege') num 13 if college.find('ege') != -1: print('was found') else: print('was not found') was found if college.find('easdfasfd') != -1: print('was found') else: print('was not found') was not found help(replace) Traceback (most recent call last): File "/usr/lib/python3.12/idlelib/run.py", line 580, in runcode exec(code, self.locals) File "", line 1, in NameError: name 'replace' is not defined help(str.replace) Help on method_descriptor: replace(self, old, new, count=-1, /) unbound builtins.str method Return a copy with all occurrences of substring old replaced by new. count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences. If the optional argument count is given, only the first count occurrences are replaced. college 'Skidmore College' replaced = college.replace('o','0') replaced 'Skidm0re C0llege' replaced = college.replace('College','University') replaced 'Skidmore University' college 'Skidmore College' replaced 'Skidmore University' newword = 'the'.upper() newword 'THE' college 'Skidmore College' college[3:6] 'dmo' len(college) 16 sentence = 'Skidmore College was founded in 1903' min(sentence) ' ' max(sentence) 'w' ord('w') 119 ord(' ') 32 ord('A') 65 sentence 'Skidmore College was founded in 1903' sentence[9] 'C' sentence[9:11] 'Co' sentence[9:12] 'Col' sentence[9:len(sentence)] 'College was founded in 1903' sentence[9:] 'College was founded in 1903' sentence[:9] 'Skidmore ' len(sentence) 36 sentence[9:20] 'College was' sentence 'Skidmore College was founded in 1903' 'mor' in sentence True 'moe' in sentence False sentence.find('mor') 4 sentence.find('moe') -1 'moe' not in sentence True 'hey' * 5 'heyheyheyheyhey' x = 'hey' * 5 x 'heyheyheyheyhey' mylist = [10,8,99,75] len(mylist) 4 mylist[0] 10 mylist[1] 8 mylist[2] 99 mylist[3] 75 mylist[4] Traceback (most recent call last): File "/usr/lib/python3.12/idlelib/run.py", line 580, in runcode exec(code, self.locals) File "", line 1, in IndexError: list index out of range mylist[1:3] [8, 99] mylist[-1] 75 mylist[-2] 99 mylist[-3] 8 mylist[-4] 10 mylist [10, 8, 99, 75] mylist[len(mylist) - 1] 75 mylist[-1] 75 mylist.append(100) mylist [10, 8, 99, 75, 100] mylist.append(7) mylist [10, 8, 99, 75, 100, 7] help(list.append) Help on method_descriptor: append(self, object, /) unbound builtins.list method Append object to the end of the list. mylist.append(87) mylist [10, 8, 99, 75, 100, 7, 87] len(mylist) 7 mylist[0] 10 mylist[1] 8 mylist[-1] 87 mylist[6] 87 mylist [10, 8, 99, 75, 100, 7, 87] mylist[0] = 200 mylist [200, 8, 99, 75, 100, 7, 87] print(mylist[0]) 200 help(list.remove) Help on method_descriptor: remove(self, value, /) unbound builtins.list method Remove first occurrence of value. Raises ValueError if the value is not present. mylist [200, 8, 99, 75, 100, 7, 87] mylist.remove(75) mylist [200, 8, 99, 100, 7, 87] help(list.insert) Help on method_descriptor: insert(self, index, object, /) unbound builtins.list method Insert object before index. mylist [200, 8, 99, 100, 7, 87] mylist.insert(2, 98) mylist [200, 8, 98, 99, 100, 7, 87] mylist.insert(0, 500) mylist [500, 200, 8, 98, 99, 100, 7, 87] mylist.remove(6666) Traceback (most recent call last): File "/usr/lib/python3.12/idlelib/run.py", line 580, in runcode exec(code, self.locals) File "", line 1, in ValueError: list.remove(x): x not in list mylist.clear() mylist [] len(mylist) 0 mylist[0] Traceback (most recent call last): File "/usr/lib/python3.12/idlelib/run.py", line 580, in runcode exec(code, self.locals) File "", line 1, in IndexError: list index out of range help(list.count) Help on method_descriptor: count(self, value, /) unbound builtins.list method Return number of occurrences of value. mylist = [9,7,44,34,7,99,7,-7] mylist.count(7) 3 import random help(random.choice) Help on method choice in module random: choice(seq) method of random.Random instance Choose a random element from a non-empty sequence.