''' Purpose: consider string casing functions ''' text = input( "Enter text: " ) substring = input( "Enter substring: " ) i = input( "Enter index: " ) i = int( i ) print() # count occurrences of text total = text.count( substring ) # count( x ) needs at least one argument! --> it looks for x inside the string text and counts how many times x occurs # it matches EXACTLY!! Cases matter! from_index_i_on = text.count( substring, i ) # sometimes, you don't want to find all occurrences # count() takes an optional 2nd argument = count( x, y ) # where y is the place you should start looking in the string, like from place 1 or 2 or 3 and so on. # includes y and then to the end of the string print( "text.count( substring ) =", total, " # count all" ) print( "text.count( substring,", i, ") =", from_index_i_on, " # count starting from index", i ) # spaces inside a string is a character --> counts towards the length and can be used with the count() function # if you put '' in the substring --> this is an empty string # metaphysical; in front/after each character is an empty string --> counts that # kinda weird ; not something that's practically used # parameter: things that define the arguments for each function --> tells the function what to expect when you use it # count(x) --> x is our parameter that tells the count() function to expect at least one argument # where x is actually a real value that we substitute in so that we can use the count() function