Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input()
- sum = 0
- for i in range(len(text)):
- if text[i] == "<":
- sum = 0
- for b in range(i, len(text)):
- if ord(text[b]) in range(48, 58):
- sum += int(text[b])
- if text[b] == ">":
- print(f"Found {sum} carat diamond")
- break
- if sum == 0:
- print(f"Better luck next time")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement