+ 1

Security code coach task

In the security task can the input involve 2 $ signs or only one and if yes how do I output alarm and quiet ?

11th Feb 2021, 7:39 PM
Med Hedi Bejaoui
Med Hedi Bejaoui - avatar
5 Respuestas
+ 8
Med Hedi Bejaoui , please show us your attempt. thanks!
11th Feb 2021, 8:13 PM
Lothar
Lothar - avatar
+ 5
"There is one money location, one thief, and any number of guards on each floor of the casino." You can have multiple guards. In Python you can remove all of the floor 'x' from the input string. Then all that will be left are the $, T, and G's. Then all you need to do is a check if T is next to $ ('T
#x27; or '$T') in the string and output the correlating string. 'ALARM' or 'quiet'.
12th Feb 2021, 1:33 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
Check out 👇 s=input() a=0 for i in range(len(s)-1): if s[i] =='
#x27;or s[i]=='T': for j in range(i+1,len(s)): if s[j]=='G': a=1 break elif s[j]=='T' or s[j]=='
#x27;: a=2 break if a==1: print ("quiet") break elif a==2: print("ALARM") break
23rd Jul 2021, 3:17 PM
Tharul Nejana
Tharul Nejana - avatar
+ 1
It is one $ sign.There are one place for 💰 one for T(thief) one for (G)guard the other place are X characters.
11th Feb 2021, 7:52 PM
HBhZ_C
HBhZ_C - avatar
0
Did you ever solve this? I found a interesting solution if you're interested?
15th Dec 2021, 3:12 PM
Stephen Norton
Stephen Norton - avatar