
def countBob( string ):

	count = 0
	start = 0

	while string.find( "bob" ) != -1:

		start = string.find( "bob" ) # Finds the first character where the substring "bob" first appears.
		
		# Strings are immutable. Hence, we store the new string by slicing the existing string from position start + 1 to the last position(length of string - 1)
		string = string[ start + 1 : ]
		count += 1

	return count

print( "Remember all the characters in the string should be in LOWERCASE" )
string = input( "Enter the string: ")
print( "Number of times bob occurs is: " + str( countBob( string ) ) )

# Uncomment the following line if you are using Console/Terminal
# input("Press any key to exit..." )


def countBob( string ):

	count = 0
	start = 0

	while string.find( "bob" ) != -1:

		start = string.find( "bob" ) # Finds the first character where the substring "bob" first appears.
		
		# Strings are immutable. Hence, we store the new string by slicing the existing string from position start + 1 to the last position(length of string - 1)
		string = string[ start + 1 : ]
		count += 1

	return count

print( "Remember all the characters in the string should be in LOWERCASE" )
string = input( "Enter the string: ")

print( "Number of times bob occurs is: " + str( countBob( string ) ) )

Add the answer of seventh question of Assignment 3
Add the answer of seventh question of Assignment 3

  
  def countBob( string ):
  
  	count = 0
  	start = 0
  
  	while string.find( "bob" ) != -1:
  
  		start = string.find( "bob" ) # Finds the first character where the substring "bob" first appears.
  		
  		# Strings are immutable. Hence, we store the new string by slicing the existing string from position start + 1 to the last position(length of string - 1)
  		string = string[ start + 1 : ]
  		count += 1
  
  	return count
  
  print( "Remember all the characters in the string should be in LOWERCASE" )
  string = input( "Enter the string: ")
+ 
  print( "Number of times bob occurs is: " + str( countBob( string ) ) )
  
- # Uncomment the following line if you are using Console/Terminal
- # input("Press any key to exit..." )
- 
Add the answer of seventh question of Assignment 3
## Code Before:

def countBob( string ):

	count = 0
	start = 0

	while string.find( "bob" ) != -1:

		start = string.find( "bob" ) # Finds the first character where the substring "bob" first appears.
		
		# Strings are immutable. Hence, we store the new string by slicing the existing string from position start + 1 to the last position(length of string - 1)
		string = string[ start + 1 : ]
		count += 1

	return count

print( "Remember all the characters in the string should be in LOWERCASE" )
string = input( "Enter the string: ")
print( "Number of times bob occurs is: " + str( countBob( string ) ) )

# Uncomment the following line if you are using Console/Terminal
# input("Press any key to exit..." )

## Instruction:
Add the answer of seventh question of Assignment 3
## Code After:

def countBob( string ):

	count = 0
	start = 0

	while string.find( "bob" ) != -1:

		start = string.find( "bob" ) # Finds the first character where the substring "bob" first appears.
		
		# Strings are immutable. Hence, we store the new string by slicing the existing string from position start + 1 to the last position(length of string - 1)
		string = string[ start + 1 : ]
		count += 1

	return count

print( "Remember all the characters in the string should be in LOWERCASE" )
string = input( "Enter the string: ")

print( "Number of times bob occurs is: " + str( countBob( string ) ) )
