Write a function to read a string and one character & check whether given character is present in the given string or not?(Don't use any built in function).
Answers
Answered by
0
Answer:
inputString = input("Enter a string: ").casefold()
#casefold() is to ensure that uppercase and lower case charachter is treated same.
#If you don't want, you can remove casefold()
tempStr = ''
for char in inputString:
if char not in tempStr:
print(char, ', ', inputString.count(char))
tempStr = tempStr+char
Explanation:
Similar questions