Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
1,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. array = input().split(", ")
  2.  
  3. if array.pop() == "wolf":
  4.     print("Please go away and stop eating my sheep")
  5.     raise SystemExit
  6.  
  7. arrReversed = array[::-1]
  8.  
  9. for i in range(len(arrReversed)):
  10.     if arrReversed[i] != "sheep":
  11.         print(f"Oi! Sheep number {i + 1}! You are about to be eaten by a wolf!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement