Sunday, October 13, 2019

Dimik oj - 14 অক্ষরের ঘনঘটা python3 solution

 if __name__ == '__main__':
    t = int(input())
    for i in range(t):
        s = input()
        ch = input()
        ans = s.count(ch)
        if ans > 0:
            print("Occurrence of '%c' in '%s' = %d" %(ch,s,ans))
        else:
            print("'%c' is not present"% ch)

No comments: