Hint
Input - Python
Input Character - o
Output - Pythn
str = "Python"
ch = "o"
print(str.replace(ch," "))
>> Pyth n
Hint
Input - Python
Input Character - o
Output - 1
string = "Python"
char = "y"
count = 0
for i in range(len(string)):
if(string[i] == char):
count = count + 1
print(count)
>> 1
Hint
Input - Python
Input Character - onypth
Output - Anagrams
str1 = "python"
str2 = "yonthp"
if (sorted(str1) == sorted(str2)):
print("Anagram")
else:
print("Not an anagram")
> Anagram
Hint
Input - madam
Output - Palindrome
string = "madam"
if(string == string[:: - 1]):
print("Palindrome")
else:
print("Not a Palindrome")
> Palindrome
Hint
Input - a
Output - Not a Digit
ch = 'a'
if ch >= '0' and ch <= '9':
print("Digit")
else:
print("Not a Digit")
> Not a Digit
Hint
Input - m m
Input charcter - a
Output - mam
string = "m d m"
result = ''
ch = "a"
for i in string:
if i == ' ':
i = ch
result += i
print(result)
> madam