diff --git a/Number-Related/Sum-of-digits.md b/Number-Related/Sum-of-digits.md index ac9261a..75c072a 100644 --- a/Number-Related/Sum-of-digits.md +++ b/Number-Related/Sum-of-digits.md @@ -21,7 +21,6 @@ nums = [13,89,65,42,12,11,56] total = get_sum(nums) print("The total of each elements:",total) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Explanation It’s super simple. @@ -59,9 +58,3 @@ What is the shortcut way to sum all the numbers in a list? ## Take Away Use the sum function to sum all the numbers in a list. - - -[](../Loop-Related/Sum-of-elements.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` \ No newline at end of file diff --git a/Number-Related/max-of-two.md b/Number-Related/max-of-two.md index 9718149..f35c1c7 100644 --- a/Number-Related/max-of-two.md +++ b/Number-Related/max-of-two.md @@ -21,7 +21,6 @@ else: largest = num1 print("Largest number you entered is: ", largest) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Shortcut Another simple and alternative solution is to send the numbers to the max function. @@ -31,7 +30,6 @@ num2 = int(input("Second number: ")) largest = max(num1, num2) print("Largest number you entered is: ", largest) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Alternative Solution Another alternative approach is to use the floor method from the math module. If you pass a number with a fraction to the math.floor function, it will return you the integer part of the number. @@ -42,20 +40,3 @@ import math result = math.floor(3.4) print(result) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - -## Alternative Solution -Do you want to see your name in this app as a contributor? - -If yes, find a better solution or alternative solution of any of the problems here. Then, send your solution with a code explanation to programming.hero1@gmail.com - -If your solution is approved by the Team Programming Hero, we will publish your solution in the app with your name as the contributor. - -> That would be fun. - - -[](Max-of-three.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` - diff --git a/Prime-number/Check-Prime.md b/Prime-number/Check-Prime.md index c8af603..72cc687 100644 --- a/Prime-number/Check-Prime.md +++ b/Prime-number/Check-Prime.md @@ -30,8 +30,6 @@ else: print('Your number is not a Prime') ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ### Explanation The core part of the algorithm is the is_prime function. @@ -54,9 +52,3 @@ There are other solutions to this problem as well. We encourage you to google, ## Take Away A prime number is only divisible by 1 and the number itself. - - -[](Prime-Numbers.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` diff --git a/Prime-number/Prime-Factors.md b/Prime-number/Prime-Factors.md index b38e278..d6d99a6 100644 --- a/Prime-number/Prime-Factors.md +++ b/Prime-number/Prime-Factors.md @@ -37,13 +37,6 @@ num = int (input('Enter your number: ')) factors = get_prime_factors(num) print(factors) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** -## take Away +## Take Away Prime factor is a prime number that divides the provided number. - - -[](Smallest-prime-factor.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` \ No newline at end of file diff --git a/Prime-number/Prime-Numbers.md b/Prime-number/Prime-Numbers.md index e471984..8e21531 100644 --- a/Prime-number/Prime-Numbers.md +++ b/Prime-number/Prime-Numbers.md @@ -29,8 +29,6 @@ primes = all_primes(num) print(primes) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## Explanation The first one is the is_prime that you have seen before. Now we created another function named all_primes. In the all_primes function, we create a list named primes to hold the prime numbers. Then run a for loop using range. @@ -41,9 +39,3 @@ Inside the loop, call the is_prime function and check the return. If the return Then return the primes list. That’s it. - - -[](Prime-Factors.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` \ No newline at end of file diff --git a/Prime-number/Smallest-prime-factor.md b/Prime-number/Smallest-prime-factor.md index 313df40..5bdb311 100644 --- a/Prime-number/Smallest-prime-factor.md +++ b/Prime-number/Smallest-prime-factor.md @@ -25,10 +25,3 @@ print('The smallest prime factor is: ', smallest_factor) Since we need only one factor. We can do it more easily. Just run a while loop. The condition of the loop is checking the remainder. If there is no remainder, the number got divided and you got the prime factor. If the remainder is not 0, then increase the factor by one. - - - -[](../Reverse/Reverse-String.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` \ No newline at end of file diff --git a/Programming-Contest/Programming-Contest.md b/Programming-Contest/Programming-Contest.md index c689586..553af2f 100644 --- a/Programming-Contest/Programming-Contest.md +++ b/Programming-Contest/Programming-Contest.md @@ -19,7 +19,3 @@ The real-world problems that we are covering in Programming Hero will be enough ## Keep going Keep going. Keep learning. Happy Journey. - - -[](../Simple-Game/Guess-game.md) - \ No newline at end of file diff --git a/Reverse/Reverse-Number.md b/Reverse/Reverse-Number.md index 7174f0a..2eb6fa5 100644 --- a/Reverse/Reverse-Number.md +++ b/Reverse/Reverse-Number.md @@ -42,8 +42,6 @@ reverse = reverse_num(n) print("Reverse of the number:",reverse) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## Explanation Once you understand the hint, the algorithm will become super easy. @@ -52,10 +50,3 @@ Inside the while loop, we are getting the last digit by getting remainder. Then Finally, set the new value of the num by dividing by 10. That’s it. - - -[](Reverse-word.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` - diff --git a/Reverse/Reverse-String-(recursive).md b/Reverse/Reverse-String-(recursive).md index 096efa4..0fa3462 100644 --- a/Reverse/Reverse-String-(recursive).md +++ b/Reverse/Reverse-String-(recursive).md @@ -31,8 +31,6 @@ print(str[3:]) print(str[:]) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## Solution ```python @@ -46,7 +44,6 @@ str = input("Enter your string: ") rev_str = reverse_recur(str) print ('Reverse of your string: ', rev_str) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Explanation In the recursive function, look at the else condition. We are selecting str[1:] @@ -68,8 +65,6 @@ txt = "Welcome to the Jungle" print(txt[::-1]) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## Quiz How would you slide a string and get the first five characters? @@ -83,14 +78,6 @@ How would you slide a string and get the first five characters?
The answer is: 3
-## take Away +## Take Away You can slice a string to get a part of the string. - - - -[](Reverse-Number.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` - diff --git a/Reverse/Reverse-String-(stack).md b/Reverse/Reverse-String-(stack).md index 7a9e6b3..d56bce0 100644 --- a/Reverse/Reverse-String-(stack).md +++ b/Reverse/Reverse-String-(stack).md @@ -32,8 +32,6 @@ reverse = reverse_stack(usr_str) print('Reversed is: ', reverse) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## Explanation In the function, we declared a list named stack. And then we loop through the input string and put every character of the string inside the list. @@ -48,10 +46,3 @@ The overall idea is very simple, take the last element and add keep adding it. Hence, the last element will come first and you will put it in the first position. And then, in the next iteration, the second to the last element will be coming and will get added. If needed, add a print command to see how it works. - - -[](Reverse-String-(recursive).md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` - diff --git a/Reverse/Reverse-String.md b/Reverse/Reverse-String.md index cb8e7db..2320995 100644 --- a/Reverse/Reverse-String.md +++ b/Reverse/Reverse-String.md @@ -31,8 +31,6 @@ print('hello' + 'world') print('h'+'w') ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - However, a string is not a list. ## Solution @@ -48,8 +46,6 @@ str = input("Enter your string: ") result = reverse_string(str) print(result) ``` - -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Explanation A simple trick will make it work. @@ -98,10 +94,3 @@ Will you be able to append, remove or set a character to string by the index? ## take Away A string is an immutable ordered sequence. - - - -[](Reverse-String-(stack).md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` diff --git a/Reverse/Reverse-word.md b/Reverse/Reverse-word.md index da81e02..0a51554 100644 --- a/Reverse/Reverse-word.md +++ b/Reverse/Reverse-word.md @@ -21,8 +21,6 @@ together = ' '.join(words) print(together) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## Solution ```python @@ -36,7 +34,6 @@ reverse = reverse_words(usr_input) print('Reversed words are: ', reverse) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Explanation Once you understand the split and the join method, this code should become super easy for you. @@ -83,9 +80,9 @@ How would you join each string in the words list by the hyphen(-)? ## Reverse domain -Let’s say, you have the website name www.programming-hero.com +Let’s say, you have the website name www.abc.com -Now you want to reverse the domain name: com.programming-hero.www +Now you want to reverse the domain name: com.abc.www ```python site='www.programming-hero.com' @@ -95,7 +92,6 @@ rev = '.'.join(parts) print(rev) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** Alternatively, you can write the whole code in one line. ```python @@ -104,16 +100,6 @@ rev = '.'.join(reversed(site.split('.'))) print(rev) ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** - ## take Away The split method breaks string into elements of a list. - - - -[](../Medium/Check-palindrome.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` - diff --git a/Simple-Game/Cows-and-bulls(4digits).md b/Simple-Game/Cows-and-bulls(4digits).md index 0b9bcce..77d6304 100644 --- a/Simple-Game/Cows-and-bulls(4digits).md +++ b/Simple-Game/Cows-and-bulls(4digits).md @@ -46,7 +46,6 @@ while remaining_try > 0: print("You lost the game.") break ``` -**[Try it on Programming Hero](https://play.google.com/store/apps/details?id=com.learnprogramming.codecamp)** ## Explanation After solving the Bulls and cows for 2 digits, this one should become easier for you. @@ -54,10 +53,3 @@ After solving the Bulls and cows for 2 digits, this one should become easier for However, solving this one by using if-else that we did for 2 digit bulls and cows game will become very harder. That's why we created the get_bulls_cows function. Inside that, we created a loop. For each digit, check the digit in the same place. - - - -[](Word-completion.md) - - -tags: `programming-hero` `python` `python3` `problem-solving` `programming` `coding-challenge` `interview` `learn-python` `python-tutorial` `programming-exercises` `programming-challenges` `programming-fundamentals` `programming-contest` `python-coding-challenges` `python-problem-solving` \ No newline at end of file