Created math.py - #16
Open
keshavgbpecdelhi wants to merge 1 commit into
Open
Conversation
Right now this consists of these functions which are as follows : list_hcf(l) - HCF of a list list_prime(l) - Primes in a list next_prime(n) - next prime of a number prev_prime(n) - previous prime of a number list_lcm(a) - LCM of a list hcf_k_elements(l,k) - HCF of k elements in a list lcm_k_elements(l, k) - LCM of k elements in a list where k and n implies numbers (integers) and l implies list.
keshavgbpecdelhi
force-pushed
the
maths
branch
from
September 17, 2020 09:46
366beaa to
f581fcb
Compare
devkapilbansal
requested changes
Oct 1, 2020
Comment on lines
+7
to
+13
| #list_hcf(l) - HCF of a list | ||
| #list_prime(l) - Primes in a list | ||
| #next_prime(n) - next prime of a number | ||
| #prev_prime(n) - previous prime of a number | ||
| #list_lcm(a) - LCM of a list | ||
| #hcf_k_elements(l,k) - HCF of k elements in a list | ||
| #lcm_k_elements(l, k) - LCM of k elements in a list |
Collaborator
There was a problem hiding this comment.
@keshavgbpecdelhi add these single-line comments in function themselves or create a docstring for them
Comment on lines
+70
to
+79
| # def nextPrime(n): | ||
| # while True: | ||
| # n+=1 | ||
| # for i in range(2,n): | ||
| # if n%i == 0: | ||
| # break | ||
| # else: | ||
| # return n | ||
|
|
||
| # print(nextPrime(1)) |
Collaborator
There was a problem hiding this comment.
Why this code block is commented?
Comment on lines
+97
to
+117
| # def lcm(x,y): | ||
| # ''' | ||
| # args: | ||
| # :integer: (number) : a integer number | ||
| # :algo: (integer): lcm of two numbers | ||
| # return: | ||
| # lcm of the two numbers | ||
| # ''' | ||
| # res=0 | ||
| # mx=max(x,y) | ||
| # mn=min(x,y) | ||
| # for i in range(1,mx+1,1): | ||
| # temp=mx*i | ||
| # try: | ||
| # if(temp%mn==0): | ||
| # res=temp | ||
| # break | ||
| # except ZeroDivisionError: | ||
| # res=0 | ||
| # break | ||
| # return res |
Collaborator
There was a problem hiding this comment.
Remove this if it is not required @keshavgbpecdelhi
Comment on lines
+158
to
+160
|
|
||
|
|
||
|
|
Collaborator
There was a problem hiding this comment.
Only two lines are necessary. Why you use three?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now this consists of these functions which are as follows :
list_hcf(l) - HCF of a list
list_prime(l) - Primes in a list
next_prime(n) - next prime of a number
prev_prime(n) - previous prime of a number
list_lcm(a) - LCM of a list
hcf_k_elements(l,k) - HCF of k elements in a list
lcm_k_elements(l, k) - LCM of k elements in a list
where k and n implies numbers (integers) and l implies list.
Fixes #14