Skip to content
This repository was archived by the owner on Oct 14, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e595121
Add alternative approach
VaibhaveS Sep 21, 2020
be16a6b
Cleaned reverse palindrome
VaibhaveS Sep 21, 2020
3ab90e5
Merge pull request #18 from codePerfectPlus/master
codeperfectplus Sep 25, 2020
339fb20
Merge pull request #19 from codePerfectPlus/master
codeperfectplus Sep 25, 2020
629dfe7
Uploaded a file
yashsoni27 Sep 25, 2020
7478812
Merge pull request #20 from yashsoni27/patch-1
codeperfectplus Sep 25, 2020
7c6e7c2
even-odd.py
kjvjobin Sep 25, 2020
9404910
Merge pull request #21 from jobinkeecheril/master
codeperfectplus Sep 25, 2020
08059d4
added mergesort.py
heyyviv Sep 25, 2020
0833084
Merge pull request #23 from heyyviv/master
codeperfectplus Sep 25, 2020
343c8fa
Added insertion sort program
kgsantosh770 Sep 25, 2020
8c43ffe
Update issue templates
codeperfectplus Sep 25, 2020
6e47590
Merge pull request #25 from santhoshkrishna770/master
codeperfectplus Sep 25, 2020
28f08ec
Update create-an-issue.md
codeperfectplus Sep 26, 2020
7d35f1f
Create python-publish.yml
codeperfectplus Sep 28, 2020
2345883
Delete python-publish.yml
codeperfectplus Sep 28, 2020
cd09c8d
Update README.md
codeperfectplus Sep 29, 2020
d244540
screen recorder with python
DzunN86 Sep 30, 2020
079119d
add music player
DzunN86 Sep 30, 2020
226a61e
Merge pull request #49 from DzunN86/master
codeperfectplus Sep 30, 2020
80dd4e6
Merge pull request #48 from VaibhaveS/master
codeperfectplus Sep 30, 2020
637d52a
Added Prime Number From Digit Words
bhaveshlohana Sep 30, 2020
7c94985
Merge pull request #50 from bhaveshlohana/master
codeperfectplus Sep 30, 2020
f723450
Create Binary_Tree_algo.py
Soumya-Ranjan-Bharti Sep 30, 2020
c02bf6a
added many algorithms and problems
mystery2828 Sep 30, 2020
f8feddf
Merge pull request #55 from mystery2828/master
codeperfectplus Sep 30, 2020
d289a9f
Merge pull request #52 from Soumya-Ranjan-Bharti/master
codeperfectplus Sep 30, 2020
0dfa766
Added base convertor python file
prithvirajbytes Sep 30, 2020
80a4849
Update BasicCalculator.py
sda06407 Sep 30, 2020
cb16f5a
Update BasicCalculator.py
sda06407 Sep 30, 2020
28929c0
Create reverse_name.py
codeshruti Sep 30, 2020
47b2177
Fixed the zero division error in BasicCalaulator.py
sakshamsingh01 Sep 30, 2020
48e9362
Merge pull request #58 from codeshruti/master
codeperfectplus Sep 30, 2020
bea74fe
Merge pull request #59 from SakshamSingh-v2/master
codeperfectplus Sep 30, 2020
e94eb06
Merge pull request #57 from sda06407/master
codeperfectplus Sep 30, 2020
e5aa4f4
Merge pull request #56 from prasantakumarbiswas/prasanta
codeperfectplus Sep 30, 2020
430c2ee
Create FriendshipCalculator.py
Harsha-Ambati Oct 1, 2020
d009a0f
Update FriendshipCalculator.py
Harsha-Ambati Oct 1, 2020
0dce05b
Create BlackJack_Game.py
utkhagni13 Oct 1, 2020
b34cded
Create Password_strength_check.py
Harsha-Ambati Oct 1, 2020
3e269df
Update Bubble-Sort-algo.py
Oct 1, 2020
8b31e8e
Create BinarytreeClassbased.py
Oct 1, 2020
cd14afd
Adding speedtest file
viswa5427 Oct 1, 2020
9d379e8
Create password_manager.py
rahulbiswas12 Oct 1, 2020
1980a8e
Added Tower of Hanoi Python
tauseefmohammed2 Oct 1, 2020
4f07eeb
Merge pull request #103 from tauseefmohammed2/Tower-Of-Hanoi
codeperfectplus Oct 1, 2020
d244649
Merge pull request #102 from rahulbiswas12/master
codeperfectplus Oct 1, 2020
ec9474b
Merge pull request #98 from dkaiamit/patch-2
codeperfectplus Oct 1, 2020
b8974df
Merge pull request #96 from dkaiamit/patch-1
codeperfectplus Oct 1, 2020
56c3cf6
Merge pull request #95 from utkhagni13/master
codeperfectplus Oct 1, 2020
92f23e3
Merge pull request #93 from Harsha-Ambati/master
codeperfectplus Oct 1, 2020
749d463
Merge pull request #100 from viswa5427/master
codeperfectplus Oct 1, 2020
3c85c6f
Update README.md
codeperfectplus Oct 4, 2020
dfbda79
Update README.md
codeperfectplus Oct 4, 2020
fe52f3b
Create Check for URL in a String
gaurav1205 Oct 10, 2021
d50b9d1
Create Extract Unique values dictionary values
gaurav1205 Oct 10, 2021
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
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/create-an-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Create an Issue
about: For creating isssue for HacktoberFest
title: ''
labels: Hacktoberfest
assignees: ''

---

**Title** -

**what will change** -

**Assignees** -

### Type of Issue
Please add/delete options that are not relevant.
- [x] Improving Code
- [x] Improving Documentation
- [x] Adding New Code

### Programming Language
Please add/delete options that are not relevant.
- [x] Python
- [x] C++
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "C:\\Users\\VISWANADH\\miniconda3\\python.exe"
}
73 changes: 73 additions & 0 deletions Python/Base Convertor Number System.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
def base_check(xnumber, xbase):
for char in xnumber[len(xnumber ) -1]:
if int(char) >= int(xbase):
return False
return True

def convert_from_10(xnumber, xbase, arr, ybase):
if int(xbase) == 2 or int(xbase) == 4 or int(xbase) == 6 or int(xbase) == 8:

if xnumber == 0:
return arr
else:
quotient = int(xnumber) // int(xbase)
remainder = int(xnumber) % int(xbase)
arr.append(remainder)
dividend = quotient
convert_from_10(dividend, xbase, arr, base)
elif int(xbase) == 16:
if int(xnumber) == 0:
return arr
else:
quotient = int(xnumber) // int(xbase)
remainder = int(xnumber) % int(xbase)
if remainder > 9:
if remainder == 10: remainder = 'A'
if remainder == 11: remainder = 'B'
if remainder == 12: remainder = 'C'
if remainder == 13: remainder = 'D'
if remainder == 14: remainder = 'E'
if remainder == 15: remainder = 'F'
arr.append(remainder)
dividend = quotient
convert_from_10(dividend, xbase, arr, ybase)
def convert_to_10(xnumber, xbase, arr, ybase):
if int(xbase) == 10:
for char in xnumber:
arr.append(char)
flipped = arr[::-1]
ans = 0
j = 0

for i in flipped:
ans = ans + (int(i) * (int(ybase) ** j))
j = j + 1
return ans
arrayfrom = []
arrayto = []
is_base_possible = False
number = input("Enter the number you would like to convert: ")

while not is_base_possible:
base = input("What is the base of this number? ")
is_base_possible = base_check(number, base)
if not is_base_possible:
print(f"The number {number} is not a base {base} number")
base = input
else:
break
dBase = input("What is the base you would like to convert to? ")
if int(base) == 10:
convert_from_10(number, dBase, arrayfrom, base)
answer = arrayfrom[::-1] # reverses the array
print(f"In base {dBase} this number is: ")
print(*answer, sep='')
elif int(dBase) == 10:
answer = convert_to_10(number, dBase, arrayto, base)
print(f"In base {dBase} this number is: {answer} ")
else:
number = convert_to_10(number, 10, arrayto, base)
convert_from_10(number, dBase, arrayfrom, base)
answer = arrayfrom[::-1]
print(f"In base {dBase} this number is: ")
print(*answer, sep='')
7 changes: 5 additions & 2 deletions Python/BasicCalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def mul(num1, num2):
return num1 * num2

def div(num1, num2):
if num2 == 0:
print("Can't divide a number by 0")
exit()
return num1 / num2

print("Please Select Operations\n "\
Expand All @@ -23,7 +26,7 @@ def div(num1, num2):
select = input("Press\n" "1 " "2 " "3 " "4 \n")

number_1 = int(input("Type Your First Number :"))
number_2 = int(input("Type YOur Second Number :"))
number_2 = int(input("Type Your Second Number :"))


if select == '1':
Expand All @@ -45,4 +48,4 @@ def div(num1, num2):
else:
print('Invalid Input ! Try aagian ')

print('Thanks for Using Calculator')
print('Thanks for Using Calculator')
55 changes: 55 additions & 0 deletions Python/Binary_Tree_algo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
class Node:

def __init__(self, data):

self.left = None
self.right = None
self.data = data


def PrintTree(self):
print(self.data)

root = Node(10)

root.PrintTree()

class Node:

def __init__(self, data):

self.left = None
self.right = None
self.data = data

def insert(self, data):
# Compare the new value with the parent node
if self.data:
if data < self.data:
if self.left is None:
self.left = Node(data)
else:
self.left.insert(data)
elif data > self.data:
if self.right is None:
self.right = Node(data)
else:
self.right.insert(data)
else:
self.data = data

# Print the tree
def PrintTree(self):
if self.left:
self.left.PrintTree()
print( self.data),
if self.right:
self.right.PrintTree()

# Use the insert method to add nodes
root = Node(12)
root.insert(6)
root.insert(14)
root.insert(3)

root.PrintTree()
24 changes: 24 additions & 0 deletions Python/BinarytreeClassbased.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
def binarytree(r):
return[r,[],[]]
def insertleft(root,newbranch):
t=root.pop(1)
if len(t)>1:
root.insert(1,[newbranch,t,[]])
else:
root.insert(1,[newbranch,[],[]])
return root
def insertright(root,newbranch):
t=root.pop(2)
if len(t)>1:
root.insert(2,[newbranch,[],t])
else:
root.insert(2,[newbranch,[],[]])
return root
def getroot(root,new):
root[0]=new
def setnew(root):
return root[0]
def getleft(root):
return root[1]
def getright(root):
return root[2]
143 changes: 143 additions & 0 deletions Python/BlackJack_Game.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import random as rn
deck = [2,3,4,5,6,7,8,9,10,'J','Q','K','A']
suit = ['spade' , 'heart' , 'diamond' , 'club']
arr = []
pl = []
dl = []

# Check Blackjack__________________________________________
def BlackJack(s):
if s==21:
return True
else:
return False

# Check Bust_______________________________________________
def Bust(s):
if s>21:
return True
else:
return False

# Check Ace is 1 or 11_____________________________________
def check_For_Ace(s):
if (s+11)<=21:
return 11
else:
return 1

# Adjust the sum___________________________________________
def check_sum(s):
if s < 21:
return s

for i in range(len(pl)-1,-1,-1):
if pl[i] == 'A':
s -= 10
break
return s

# creating a well shuffled pack of cards___________________
def startGame():
print("Welcome to the BlackJack Game:\n")
for i in suit:
for j in deck:
arr.append([i,j])
rn.shuffle(arr)

pl.append(arr[0])
pl.append(arr[1])
dl.append(arr[2])
dl.append(arr[3])

print(f'\nDealer draws {dl[0]} and [xxxxxx,xx]\n')
s = 0
for i in range(0,2):
if arr[i][1] == 'J' or arr[i][1] == 'K' or arr[i][1] == 'Q':
s += 10
elif arr[i][1] == 'A':
s += check_For_Ace(s)
else:
s += arr[i][1]
return s

# player's chance__________________________________________
def playersTurn(s):
print("You are currently at " + str(s))
print(f'Current Hand: {pl}')

s = check_sum(s)

if (BlackJack(s)):
print("Hurray......It's a BLACKJACK....You Won\n")
return 2
elif (Bust(s)):
print("You got Bust.....You Lost\n")
return 3

while(1):
i = int(input("\nHit(Press 1) or Stay(Press 0): "))
if i==1 or i==0:
return i
else:
print("Enter a valid number....\n")

if __name__ == '__main__':
s = startGame()
c = j = 0
for i in range(4,len(arr)):

j = playersTurn(s)
if j == 2 or j == 3:
j = i
break
elif j == 0:
j = i
c = 100
break
print(f'You draw {arr[i]}\n')

if arr[i][1] == 'J' or arr[i][1] == 'K' or arr[i][1] == 'Q':
c = 10
elif arr[i][1] == 'A':
c = check_For_Ace(s)
else:
c = arr[i][1]
s += c
pl.append(arr[i])

if c == 100:
sp = s
s = 0
for i in range(2,4):
if arr[i][1] == 'J' or arr[i][1] == 'K' or arr[i][1] == 'Q':
s += 10
elif arr[i][1] == 'A':
s += check_For_Ace(s)
else:
s += arr[i][1]
print(f"\nDealer's second card was {dl[1]}")

for i in range(j,len(arr)):
print(f"\nDealer is at {s}")
print(f"\nDealer's current hand: {dl}\n")

s = check_sum(s)
if (BlackJack(s)):
print("Dealer got a BlackJack and won the Game\nYou Lost\n")
break
elif (Bust(s)):
print("Dealer got Busted\nYou Won\n")
break
elif (sp < s):
print("Dealer Won the Game\n")
break

print(f"Dealer draws {arr[i]}")
dl.append(arr[i])
if arr[i][1] == 'J' or arr[i][1] == 'K' or arr[i][1] == 'Q':
s += 10
elif arr[i][1] == 'A':
s += check_For_Ace(s)
else:
s += arr[i][1]
11 changes: 9 additions & 2 deletions Python/Bubble-Sort-algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ def bubbleSort(arr):

# Driver code to test above
arr = [64, 34, 25, 12, 22, 11, 90]

#for dynamic list input
'''n=int(input('total elements of list'))
arr=[]
while (n>=1):
i=int(input('enter element'))
arr.append(i)
return (arr)
'''
bubbleSort(arr)

print ("Sorted array is:")
for i in range(len(arr)):
print ("%d" %arr[i]),
print (arr[i]),
15 changes: 15 additions & 0 deletions Python/Check for URL in a String
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Python code to find the URL from an input string
# Using the regular expression
import re

def Find(string):

# findall() has been used
# with valid conditions for urls in string
regex = r"(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))"
url = re.findall(regex,string)
return [x[0] for x in url]

# Driver Code
string = 'My Profile: https://auth.geeksforgeeks.org/user/Chinmoy%20Lenka/articles in the portal of http://www.geeksforgeeks.org/'
print("Urls: ", Find(string))
Loading