occurences of character in string python

Description

python program to get a String and a character then count the occurrence of character in the string.
Input:
Hello
o
Output:
1

Solution

s=input("Enter a String:")
c=input("Enter a Character:")
count=0
for i in range(0,len(s)):
    if(s[i]==c):
        count+=1
print(count)

Explanation

Visit each location in string s one by one 
for i in range(0,len(s)):

if character c is found, increase the count by 1



Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution