- 2
help to solve
You are building a search system and need to search for the character 'a' in an input string. Output "Match" if 'a' is found in the string, and "No match" if it's not. Sample Input great Sample Output Match
8 Réponses
+ 5
Just check ✅ indentation in your code
+ 5
Bhupal Raut
You have received 2 great answers from Lisa & Sâñtôsh
Final word of advice, you don't need to put your word in a list.
if 'a' in "bhupal":
check indentation
else:
check indentation
+ 3
This forum is for programming related discussion, not for free assignments. Show your try and explain where exactly you want help if you really want to get any help. Have a look at the below guidelines to use this forum in the most efficient way possible
https://www.sololearn.com/discuss/1316935/?ref=app
+ 3
But 'a' in quotes and check the indentation: if and else need to be on the same indentation level
+ 2
words= ["bhupal"]
if a in words:
print("Match")
else:
print("No match")
+ 2
result is error
0
# Try this one..
words= ("bhupal")
if "a" in words:
print("Match")
else:
print("No match")
0
Try to compare this (my) code with your code and you will find the errors in your code...👍