Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Python/capitalize_each_word.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import string


def solve(s):
def solve(s): #(Function is to capitalise first letter of each word )
for x in s[:].split():
s = s.replace(x, x.capitalize())
return s
Expand All @@ -17,9 +17,9 @@ def solve(s):
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')

s = input()
s = input() #(Input a string)

result = solve(s)
result = solve(s) #(Function is called by passing the parameter s)

fptr.write(result + '\n')

Expand Down
10 changes: 5 additions & 5 deletions Python/nested_list_second_lowest.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
marksheet=[]
scorelist=[]
marksheet=[] # creates a list marksheet
scorelist=[] # creates a list scorelist

if __name__ == '__main__':
for _ in range(int(input())):
name = input()
score = float(input())
name = input("Entre the name:")
score = float(input("Enter the score:"))
marksheet+=[[name,score]]
scorelist+=[score]


scorelist = list(dict.fromkeys(scorelist))
b=sorted(scorelist)[1]
b=sorted(scorelist)[1] # Function which sorts the list in the increasing order of scores

for a,c in sorted(marksheet):
if c==b:
Expand Down
6 changes: 3 additions & 3 deletions Python/sum_of_integers_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ def sum_of_int(a,b):

return a+b

num1 = int(input())
num2 = int(input())
res = sum_of_int(num1,num2)
num1 = int(input("Enter the first number:"))
num2 = int(input("Enter the second number:"))
res = sum_of_int(num1,num2) #(Calling the function by passing the parameters num1 and num2)
print(res)