-3

# Help to solve this

List Operations 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 AND I TRIED THIS WAY if 'a' in "bhupal": print("Match") else: print("NO Match") but failed

11/30/2021 10:12:19 AM

Bhupal Raut

+9

Task says "search for the character 'a' in an input string." So your code needs to read a string input, and check for character 'a' in the given input string, instead of in a hardcoded string.

+5

You put up top that "No match" should be printed but then in you're code you print "NO Match". Case totally matters

+4

It's probably the prompt. It ends up in the output and may cause a wrong answer

+4

Bhupal Raut , all code coach exercises are tested by a program that passes values for the various test cases and that receives results from the code. this will work perfectly, as long as only the demanded inputs and / or outputs are used in our codes. If we ignore this, we will fail the test cases, even if the code is actually correct.

+3

I just tested your code in Playground and it works. What error you got?

0

@Ipang can you give it a try

0

if 'a' in input(): # match else: # no match Try this and let me know

0

@Ipang if 'a' in input('bhupal'): print("Match") else: print("No Match")

0

Try x=input() If 'a' in x: print('match') Else: print('no match') The thing is that I don't think you can use input like If 'a' in input()... So try using X=input() If 'a' in input(). X is just a variable, you can swap it out with anything else

-1

@Ipang still error

-1

That's odd. Show me your most recent updated code ...

-1

class virus: virus = True ataca_cerebro = True con_mordida_te_infecta = True def virus(self, activó): self.virus = activó if self.virus: caracter = self.caracter() if self.virus and caracter: return "\nsi te infectas en 60 segundo te conviertes en un zombis\n" elif self.virus and caracter == False: return "si hace ruido atraes a los zombis" else: return "\n cura no hay " def caracter(self): self.comen = "si" self.duermen = "no" self.rompen_todo = "si" if (self.comen == "si" and self.duermen == "no" and self.rompen_todo == "si"): return True else: return False def funcion(self): print("\nvirus mortal => ", self.virus ,"\nataca al cerebro => ", self.ataca_cerebro ,"\ncon mordida te infecta => ", self.con_mordida_te_infecta) print("\nc