diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 0000000..e4ddf94 --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,39 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome + +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: > + Thanks for opening your first Issue and showing your interest in @Novice-Paradigm! :bowtie: + + Feel free to join us over [Slack](https://join.slack.com/t/noviceparadigm/shared_invite/enQtNDIyMjczMzA1MzgyLWNlYmY2NjE2MGM3OTZkY2ZkNWI0ZDY2MjE0YTk2NDhjNzRmOTMyYjM0YjYwYmMxN2QxZjRiMTYzNmMyM2JlNTk) or on [Facebook](https://www.facebook.com/noviceparadigm/) for communicate with other contributors. :v: + + Please apply for [Hacktoberfest](https://hacktoberfest.digitalocean.com/). It's a fest celebrating open source where you get to win a free hacktoberfest t-shirt! :tshirt: only in October. Hurry! + + If you like this repository, don't forget to star it using `Star` button available at top right :blush: + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome + +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + Thanks for showing your interest in @Novice-Paradigm! :bowtie: + + Feel free to join us over [Slack](https://join.slack.com/t/noviceparadigm/shared_invite/enQtNDIyMjczMzA1MzgyLWNlYmY2NjE2MGM3OTZkY2ZkNWI0ZDY2MjE0YTk2NDhjNzRmOTMyYjM0YjYwYmMxN2QxZjRiMTYzNmMyM2JlNTk) or on [Facebook](https://www.facebook.com/noviceparadigm/) for communicate with other contributors. :v: + + Please apply for [Hacktoberfest](https://hacktoberfest.digitalocean.com/). It's a fest celebrating open source where you get to win a free hacktoberfest t-shirt! :tshirt: only in October. Hurry! + + If you like this repository, don't forget to star it using `Star` button available at top right :blush: + +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge + +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > + Congrats on merging your first Pull Request! We here at @Novice-Paradigm are proud of you! + + Feel free to join us over [Slack](https://join.slack.com/t/noviceparadigm/shared_invite/enQtNDIyMjczMzA1MzgyLWNlYmY2NjE2MGM3OTZkY2ZkNWI0ZDY2MjE0YTk2NDhjNzRmOTMyYjM0YjYwYmMxN2QxZjRiMTYzNmMyM2JlNTk) or on [Facebook](https://www.facebook.com/noviceparadigm/) for communicate with other contributors. :v: + + Please apply for [Hacktoberfest](https://hacktoberfest.digitalocean.com/). It's a fest celebrating open source where you get to win a free hacktoberfest t-shirt! :tshirt: only in October. Hurry! + + If you like this repository, don't forget to star it using `Star` button available at top right :blush: + +# It is recommended to include as many gifs and emojis as possible! diff --git a/Books/Automate the Boring Stuff with Python (2015).pdf b/Books/Automate the Boring Stuff with Python (2015).pdf new file mode 100644 index 0000000..796bf9c Binary files /dev/null and b/Books/Automate the Boring Stuff with Python (2015).pdf differ diff --git a/Books/Python - Learning 4th Edition.pdf b/Books/Python - Learning 4th Edition.pdf new file mode 100644 index 0000000..a9e6998 Binary files /dev/null and b/Books/Python - Learning 4th Edition.pdf differ diff --git a/README.md b/README.md index 253ff5f..5fdf3d2 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ If you are new to git and github, to make your first contributions, visit this: ## Diving Into Python ### Book +- [Python For You and me by Kushal Das](https://pymbook.readthedocs.io/en/latest/) - [Learn Python the Hard Way by Zed Shaw](Books/LPTHW.pdf) ### Online Courses @@ -16,4 +17,8 @@ If you are new to git and github, to make your first contributions, visit this: - [Python Docs](https://docs.python.org/3/tutorial/) - [TutorialsPoint](https://www.tutorialspoint.com/python/index.htm) +### Youtube Channels +- [thenewboston](https://www.youtube.com/watch?v=HBxCHonP6Ro&list=PL6gx4Cwl9DGAcbMi1sH6oAMk4JHw91mC_) +- [Python Docs](https://www.youtube.com/watch?v=oVp1vrfL_w4&list=PLQVvvaa0QuDe8XSftW-RAxdo6OmaeL85M) + For some Sample Problems and to get started [click here](Src) diff --git a/Src/Largefactorial.py b/Src/Largefactorial.py new file mode 100644 index 0000000..3b8276a --- /dev/null +++ b/Src/Largefactorial.py @@ -0,0 +1,15 @@ +#Input the number whose factorial is to be calculated +def range_prod(lo,hi): + if lo+1 < hi: + mid = (hi+lo)//2 + return range_prod(lo,mid) * range_prod(mid+1,hi) + if lo == hi: + return lo + return lo*hi +# The above function will reduce the multiplicaion of higher no. and could give 10X better performance than the previous one. +def fact(n): + if n < 2: + return 1 + return range_prod(1,n) +n = int(input("Enter number whose factorial is wanted ")) +print " %d! = %d " %(n,fact(n)) diff --git a/Src/Palindrome.py b/Src/Palindrome.py new file mode 100644 index 0000000..9b60c62 --- /dev/null +++ b/Src/Palindrome.py @@ -0,0 +1,27 @@ +# An example for checking whether the string is palindrome or not +# 1st of all what the palidrome string is. +# A palindrome is a word, number, or other sequence of characters which reads the same backward as forward, such as madam or racecar. +# Some well-known English palindromes are, "Able was I ere I saw Elba",[2] "A man, a plan, a canal – Panama",[3] "Madam, I'm Adam" and "Never odd or even". + +# so here is a code + +# by using for loop +x=str(input()) +y=x +a=len(x) +for i in range(0,a): + if(x[i]!=y[a-i-1]): + print("Not Palindrome") + break +if(i==a-1): + print("Palindrome") + + +# it is by list method + +x=(input()) +x=list(x) # this converts x str into list +if(x==x[::-1]): # x[::-1] implies it reverse the x list + print("Palindrome") +else: + print("Not Palindrome") diff --git a/Src/PrimeNumbers/PrimeRange_EffectiveApproach.py b/Src/PrimeNumbers/PrimeRange_EffectiveApproach.py new file mode 100644 index 0000000..16b9b4d --- /dev/null +++ b/Src/PrimeNumbers/PrimeRange_EffectiveApproach.py @@ -0,0 +1,16 @@ +# Python program to display all the prime numbers within an interval +import math +lower = int(input("Enter lower range: ")) +upper = int(input("Enter upper range: ")) +print("Prime numbers between",lower,"and",upper,"are:") +for num in range(lower,upper + 1): + # prime numbers are greater than 1 + if num > 1: + test=int(math.sqrt(num)) +#here we will iterate upto sqrt of a number not to the number itself, the reason is : any composite number N must have atleast one factor in the range 2 to sqrt(N), which is enough to find out whether N is prime or not. + #iterating upto sqrt(num) + for i in range(2,test+1): + if (num % i) == 0: + break + else: + print(num) \ No newline at end of file diff --git a/Src/PrimeNumbers/PrimeRange_NaiveApproach.py b/Src/PrimeNumbers/PrimeRange_NaiveApproach.py new file mode 100644 index 0000000..a145c15 --- /dev/null +++ b/Src/PrimeNumbers/PrimeRange_NaiveApproach.py @@ -0,0 +1,15 @@ +# Python program to display all the prime numbers within an interval +lower = int(input("Enter lower range: ")) +upper = int(input("Enter upper range: ")) + +print("Prime numbers between",lower,"and",upper,"are:") + +for num in range(lower,upper + 1): + # prime numbers are greater than 1 + if num > 1: + for i in range(2,num): + #iterating upto num + if (num % i) == 0: + break + else: + print(num) diff --git a/Src/factorial/Largefactorial.py b/Src/factorial/Largefactorial.py new file mode 100644 index 0000000..7999617 --- /dev/null +++ b/Src/factorial/Largefactorial.py @@ -0,0 +1,17 @@ +#Input the number whose factorial is to be calculated +def range_prod(lo,hi): + if lo+1 < hi: + mid = (hi+lo)//2 + return range_prod(lo,mid) * range_prod(mid+1,hi) + if lo == hi: + return lo + return lo*hi +# The above function will reduce the multiplicaion of higher no. and +#could give 10X better performance than the conventional one. +def fact(n): + if n < 2: + return 1 + return range_prod(1,n) +n = int(input("Enter number whose factorial is wanted ")) +print " %d! = %d " %(n,fact(n)) +#this code could calculate factorial of large numbers like 10^5. diff --git a/Src/factorial/factorial.py b/Src/factorial/factorial.py new file mode 100644 index 0000000..3643107 --- /dev/null +++ b/Src/factorial/factorial.py @@ -0,0 +1,12 @@ +#Input the number whose factorial is to be calculated +def fact(n): + if(n>0): + return (n*fact(n-1)) + else: + return (1) + +n = int(input("Enter number whose factorial is wanted ")) +print " %d! = %d " %(n,fact(n)) +#this code works appropriately only for smaller values of N, more specifically +#it works only upto 973, afterforth maximum recursion depth for function fact +#exceedes and it ends up being collapsed. diff --git a/Thoughts/Pip.md b/Thoughts/Pip.md new file mode 100644 index 0000000..141dce1 --- /dev/null +++ b/Thoughts/Pip.md @@ -0,0 +1,11 @@ +**Pip** + +Pip is a rather simple concept of Python, but it's one that makes Python so amazing. +Pip is the Python package manager, and it helps you install everything you need to make +your program run. Unlike other languages, pip makes dependencies extremely easy. + +You can use pip in the cmd by simply running the command 'pip' +Look through all of the options you might want to use, but many people just use +'pip install ', and it works like magic! tada! + +Example: pip install tensorflow