-
Notifications
You must be signed in to change notification settings - Fork 0
/
challenge3.py
26 lines (22 loc) · 1 KB
/
challenge3.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
##################################################################
#Challenge 3: http://www.pythonchallenge.com/pc/def/equality.html#
##################################################################
import os
cwd = os.path.dirname(__file__)
# Mess of characters found in the end of the page source:
txt = cwd + '/resources/Challenge 3.txt'
with open(txt,'r') as file:
comment = file.read().replace('\n','-')
url = ''
for i in range(3,len(comment)-3):
if i == 0 or not comment[i-4].isupper():
if comment[i-3].isupper():
if comment[i-2].isupper():
if comment[i-1].isupper():
if comment[i].islower():
if comment[i+1].isupper():
if comment[i+2].isupper():
if comment[i+3].isupper():
if i == len(comment) - 3 or not comment[i+4].isupper():
url = url + comment[i]
print(url)