-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
H_security.py
30 lines (23 loc) · 1.03 KB
/
H_security.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Security
You are in charge of security at a casino, and there is a thief who is trying to steal the casino's money! Look over the security diagrams to make sure that you always have a guard between the thief and the money!
There is one money location, one thief, and any number of guards on each floor of the casino.
Task:
Evaluate a given floor of the casino to determine if there is a guard between the money and the thief, if there is not, you will sound an alarm.
Input Format:
A string of characters that includes $ (money), T (thief), and G (guard), that represents the layout of the casino floor.
Space on the casino floor that is not occupied by either money, the thief, or a guard is represented by the character x.
Output Format:
A string that says 'ALARM' if the money is in danger or 'quiet' if the money is safe.
Sample Input:
xxxxxGxx$xxxT
Sample Output:
ALARM
"""
import re
status = input()
search = re.search(r"[$T](.*)[$T]", status)
if "G" in search.group(1):
print("quiet")
else:
print("ALARM")