Skip to content

Commit dd5939d

Browse files
committed
Correct check of protocol
Fixed wrong protocol check
1 parent 00c39a0 commit dd5939d

6 files changed

+4
-291
lines changed

Area of triangle

Lines changed: 0 additions & 13 deletions
This file was deleted.

Pong_game.py

Lines changed: 0 additions & 171 deletions
This file was deleted.

Python Program to Remove Punctuations from a String

Lines changed: 0 additions & 18 deletions
This file was deleted.

check_internet_con.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
# Fall back to Python 2's urllib2
99
from urllib2 import URLError, urlopen
1010

11-
1211
def checkInternetConnectivity():
1312
try:
1413
url = argv[1]
15-
if "https://" or "http://" not in url:
14+
print(url)
15+
protocols = ["https://", "http://"]
16+
if not any(x for x in protocols if x in url):
1617
url = "https://" + url
18+
print("URL:" + url )
1719
except BaseException:
1820
url = "https://google.com"
1921
try:
@@ -23,5 +25,4 @@ def checkInternetConnectivity():
2325
except URLError as E:
2426
print("Connection error:%s" % E.reason)
2527

26-
2728
checkInternetConnectivity()

factorial.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

random password generator

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)