Computer Science, asked by spygirl6, 3 months ago

write the python code to accept a string and a character and display each location where the character is present within the string...pls give me the correct answer i will mark you as the brainliest!!​

Answers

Answered by shauryakumarsharma10
0

Answer:

a=input("Enter string: ")

b=intput("Enter char: ")

c=input("Enter total string: ")

result1=c.find(a)

result2=c.find(b)

print(result1, result2)

Explanation:

Okay, so a and b is where you enter the string and character that you want to find and in c you enter the string in which you want to find.

result1 and result2 shall find a, b

then print out the result.

Well I think so this code shall work out...!

Similar questions