Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def signal(locationA, locationB, trafficA, trafficB):
- if locationA == 'A' and trafficA == 'H' and locationB == 'B' and trafficB == 'L':
- action = locationA + 'Green' + locationB + 'Red'
- elif locationA == 'A' and trafficA == 'L' and locationB == 'B' and trafficB == 'L':
- action = locationA + 'green' + locationB + 'Red'
- elif locationA == 'A' and trafficA == 'L' and locationB == 'B' and trafficB == 'H':
- action = locationA + 'Red' + locationB + 'Green'
- return action
- '''
- locationA = input('Enter location for A')
- locationB = input('Enter location for B')
- trafficA = input('Traffic condition in A')
- trafficB = input('Traffic condition in B')
- '''
- locationA = 'A'
- locationB = 'B'
- trafficA = 'H'
- trafficB = 'L'
- signal(locationA, locationB, trafficA, trafficB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement