Skip to content

Commit b49bae4

Browse files
Merge pull request #1375 from Z0mbiel0ne/master
Fixed some Errors
2 parents 5881195 + 360cc36 commit b49bae4

7 files changed

+14
-292
lines changed

Area of triangle

-13
This file was deleted.

Pong_game.py

-171
This file was deleted.

Python Program to Remove Punctuations from a String

-18
This file was deleted.

check_internet_con.py

+4-3
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

-29
This file was deleted.

random password generator

-57
This file was deleted.

stone_paper_scissor/main.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
player_name = input('Please enter your name: ') # Takes Input from the user
77

88
print('Pick a hand: (0: Rock, 1: Paper, 2: Scissors)')
9-
player_hand = int(input('Please enter a number (0-2): '))
9+
10+
while True:
11+
try:
12+
player_hand = int(input('Please enter a number (0-2): '))
13+
if player_hand not in range(3):
14+
raise ValueError
15+
else:
16+
break
17+
except ValueError as e:
18+
print('Please input a correct number')
1019

1120
if utils.validate(player_hand):
1221
# Assign a random number between 0 and 2 to computer_hand using randint

0 commit comments

Comments
 (0)