Skip to content

Instantly share code, notes, and snippets.

@kavilivishnu
Created July 26, 2020 08:29
Show Gist options
  • Save kavilivishnu/dcb668605ce34eda157dafa7574f2c47 to your computer and use it in GitHub Desktop.
Save kavilivishnu/dcb668605ce34eda157dafa7574f2c47 to your computer and use it in GitHub Desktop.
A Recursive code which can be used for any filtering process.
'''
In the below code, I just took the modulo criteria for the filtering process.
if res = 0: The so and so person secured more than 80% or can be taken in any other aspect i.e. the work experience in so and so field.. etc etc.. aspects
if res = 1: >70%
if res = 2: >60%
Or the criterias can be taken the other way i.e. 0: 60% - 70%, 1: >=70% - 80%, 2: >80%
The criteria can be choosen based on changing the number than we're performin modulo operation with.
'''
Recursive Operation
'''
Below is the code:
'''
def pass_check(num):
if num < 1:
return 1
else:
res = num % 3
if num == 0:
print(num)
else:
pass_check(num - 1)
print(res, ":", num)
pass_check(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment