Skip to content

Deal with maps #1945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [All Permutations](https://github.com/TheAlgorithms/Python/blob/master/backtracking/all_permutations.py)
* [All Subsequences](https://github.com/TheAlgorithms/Python/blob/master/backtracking/all_subsequences.py)
* [Coloring](https://github.com/TheAlgorithms/Python/blob/master/backtracking/coloring.py)
* [Hamiltonian Cycle](https://github.com/TheAlgorithms/Python/blob/master/backtracking/hamiltonian_cycle.py)
* [Minimax](https://github.com/TheAlgorithms/Python/blob/master/backtracking/minimax.py)
* [N Queens](https://github.com/TheAlgorithms/Python/blob/master/backtracking/n_queens.py)
* [Sudoku](https://github.com/TheAlgorithms/Python/blob/master/backtracking/sudoku.py)
Expand Down Expand Up @@ -89,6 +90,7 @@
* [Number Of Possible Binary Trees](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/number_of_possible_binary_trees.py)
* [Red Black Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/red_black_tree.py)
* [Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/segment_tree.py)
* [Segment Tree Other](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/segment_tree_other.py)
* [Treap](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/treap.py)
* Data Structures
* Heap
Expand Down Expand Up @@ -499,6 +501,8 @@
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol1.py)
* [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol2.py)
* [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol3.py)
* Problem 26
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_26/sol1.py)
* Problem 27
* [Problem 27 Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_27/problem_27_sol1.py)
* Problem 28
Expand Down
15 changes: 9 additions & 6 deletions maths/armstrong_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ def armstrong_number(n: int) -> bool:
temp //= 10
return n == sum

def narcissistic_number(n:int) -> bool:

def narcissistic_number(n: int) -> bool:
"""Return True if n is a narcissistic number or False if it is not"""

expo = len(str(n)) #power, all number will be raised to
temp = [(int(i)**expo) for i in str(n)] # each digit will be multiplied expo times

# check if sum of cube of each digit is equal to number

expo = len(str(n)) # power, all number will be raised to
# each digit will be multiplied expo times
temp = [(int(i) ** expo) for i in str(n)]

# check if sum of cube of each digit is equal to number
return n == sum(temp)


def main():
"""
Request that user input an integer and tell them if it is Armstrong number.
Expand Down
1 change: 1 addition & 0 deletions project_euler/problem_26/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
in its decimal fraction part.
"""


def find_digit(numerator: int, digit: int) -> int:
"""
Considering any range can be provided,
Expand Down
5 changes: 4 additions & 1 deletion web_programming/crawl_google_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@

print(len(links))
for link in links:
webbrowser.open(f"http://google.com{link.get('href')}")
if link.text == "Maps":
webbrowser.open(link.get("href"))
else:
webbrowser.open(f"http://google.com{link.get('href')}")