Skip to content

python-level up-projects #7

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"files.autoSave": "afterDelay",
"screencastMode.onlyKeyboardShortcuts": true,
"terminal.integrated.fontSize": 18,
"workbench.activityBar.visible": true,
"workbench.colorTheme": "Visual Studio Dark",
"workbench.fontAliasing": "antialiased",
"workbench.statusBar.visible": true
Expand Down
17 changes: 17 additions & 0 deletions src/01 Find Prime Factors/findingprimefactors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def get_prime_factors(number):
factors=[]
factor=2
while factor<=number:
if (number%factor==0):
factors.append(factor)
number=number/factor
else:
factor=factor+1
return factors



print(get_prime_factors(21))
print(get_prime_factors(2300))
print(get_prime_factors(347))
print(get_prime_factors(0))
25 changes: 25 additions & 0 deletions src/02 Identify a Palindrome/identifyingpalindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
def palindrome(string):
text = ""
reversed_text = ""

for char in string:
if char!=" ":
text+=char.lower()



for char in reversed(string):
if char!=" ":
reversed_text+=char.lower()


return reversed_text==text



print(palindrome("No lemon no melon"))
print(palindrome("race car"))
print(palindrome("hello"))