-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed unnessary variables and added pep8 standard
- Loading branch information
Jayanth
authored and
Jayanth
committed
Jun 19, 2019
1 parent
b145e70
commit 51b5c4e
Showing
16 changed files
with
48 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
# This program is to print factorial | ||
|
||
def factorial(num): | ||
factor=1 | ||
factor = 1 | ||
|
||
for i in range(1,num+1,1): | ||
factor*=i | ||
factor *= i | ||
|
||
return factor | ||
|
||
#main | ||
|
||
# main | ||
if __name__ == "__main__": | ||
nums=int(input("Enter the number for factorial: ")) | ||
print("factorial of ",nums," is ",factorial(nums)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
# This program is to find the GCD(Greatest Commen Factore or Diviser) | ||
|
||
def gcd(val,val1): | ||
|
||
while(val1): | ||
|
||
val, val1= val1, val%val1 | ||
val, val1 = val1, val%val1 | ||
|
||
return val | ||
|
||
# Main | ||
if __name__ == "__main__": | ||
print("GCD of 16,24 is",gcd(16,24)) | ||
print("GCD of 20, 19 is",gcd(390,6777)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
#This program | ||
# This program | ||
|
||
def largest(num): | ||
l = len(num) | ||
# print(l) | ||
val=0 | ||
|
||
for i in range(0,l,1): | ||
if val<=num[i]: | ||
val=num[i] | ||
return val | ||
|
||
#main | ||
return val4 | ||
|
||
|
||
# Main | ||
if __name__ =="__main__": | ||
lists = [5,11,2,3,6,4,7,8,10,9,1] | ||
print("The largest Number is the given list is ",largest(lists)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ def checking_line(): | |
file.close() | ||
return count | ||
|
||
|
||
# Main | ||
if __name__=="__main__": | ||
print(checking_line()) |