Skip to content

Commit d20faf6

Browse files
committed
Fixed syntax changes
1 parent aadc454 commit d20faf6

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

CompetitiveProgramming/CodeChef/P36_SUBGCD.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def gcd(firstNumber, secondNumber):
6060
flag = 0
6161
size = 0
6262
for i in array:
63-
currentGCD = gcd(i, currentGCD)
64-
if currentGCD == 1:
65-
flag = 1
66-
print(count)
67-
break
63+
currentGCD = gcd(i, currentGCD)
64+
if currentGCD == 1:
65+
flag = 1
66+
print(count)
67+
break
6868

6969
if flag == 0:
70-
print(-1)
70+
print(-1)

CompetitiveProgramming/HackerEarth/Basics_Of_Input_Output/P04_PrimeNumber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import math
1616

1717
userInput = int(input())
18-
if userInput>2
18+
if userInput > 2:
1919
print("2",end = ' ')
2020
for i in range(3, userInput + 2):
2121
check = 0

CompetitiveProgramming/HackerEarth/DataStructures/Arrays/P11_JumpOut.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
array = input().split()
2828
array = [int(i) for i in array]
2929
array.insert(0,0)
30-
count =
30+
count = 0
3131
for i in range(0, check + 1):
3232
pos = array[i] + i
3333
if pos > check:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
t = int(input())
22
while t>0:
33
t-=1
4-
n1, n2 = map(int, raw_input().split())
5-
print n1*n2
4+
n1, n2 = map(int, input().split())
5+
print(n1*n2)

Programs/P40_CipherText.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ def encrypt(message, key):
1212
num = LETTERS.find(chars)
1313
num += key
1414
encrypted += LETTERS[num]
15-
else:
16-
encrypted += symbol
1715

1816
return encrypted
1917

@@ -25,8 +23,6 @@ def decrypt(message, key):
2523
num = LETTERS.find(chars)
2624
num -= key
2725
decrypted += LETTERS[num]
28-
else:
29-
decrypted += symbol
3026

3127
return decrypted
3228

Programs/P56_Pangram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def pangram(sentence):
2424
# A short version of above function:
2525
def pangram2(sentence):
2626
alphabet = list(map(chr, range(97, 123)))
27-
formattedString = ''.join(c for c in string if c.isalpha()).lower()
27+
formattedString = ''.join(c for c in sentence if c.isalpha()).lower()
2828
return set(alphabet) == set(formattedString)
2929

3030
if __name__ == '__main__':

0 commit comments

Comments
 (0)