+ 1

Challenge Security 1 out of 6 fails. Don't see it

sequence = input("") sequence.strip("x") if(sequence.find("$T") ==-1 and sequence.find("T

quot;)==-1 ): print("quiet") else: print("ALARM") Thats my code. Pretty straight forward after stripping all empty spaces i check if there is a thief next to the money. But one testcase fails and it doesn't show which.

24th Aug 2020, 10:12 PM
Oliver S
Oliver S - avatar
2 Respostas
0
Hello, thank you. I tried replace before which didn't work either. Now I found it. Replace is only part of the solution. I need to write the result back into a new variable, replace doesn't alter the original variable.
25th Aug 2020, 6:44 AM
Oliver S
Oliver S - avatar
+ 5
Strip removes characters from the left and right part of the string, not in the middle Use sequence.replace("x", "")
24th Aug 2020, 11:01 PM
Julia Shabanova
Julia Shabanova - avatar