Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d2b7a88
Create pallindrome
ARcify07 Jun 25, 2018
b4e1167
pattern.py
black0405 Jun 25, 2018
bde4345
Update pattern.py
black0405 Jun 25, 2018
9662290
Update pattern.py
black0405 Jun 25, 2018
aa84e7f
Update pattern.py
black0405 Jun 25, 2018
894b945
Add files via upload
nishchay1902 Jun 25, 2018
6c4ff3d
npy and npz files added
jatinkatyal13 Jun 25, 2018
cd1d114
Delete RegEx.py
nishchay1902 Jun 25, 2018
95b03ab
Add files via upload
nishchay1902 Jun 25, 2018
eadcbdc
Merge pull request #1 from nishchay1902/nishchay1902-patch-1
nishchay1902 Jun 25, 2018
d58f9ce
Add files via upload
AyushRawat23 Jun 25, 2018
3cca78b
Create Class
pranjalrmcf7 Jun 25, 2018
357c4d5
Create biased coin simulator
akshatpathak Jun 25, 2018
b554110
Create diagonal elements
akshatpathak Jun 25, 2018
fdeedbc
Add files via upload
kandharikarteek Jun 25, 2018
67d0c50
New code
Harmeet17 Jun 26, 2018
69124e3
Merge pull request #1 from black0405/patch-1
jatinkatyal13 Jun 26, 2018
4a52a77
Merge pull request #2 from architgupta9807/architgupta9807-patch-1
jatinkatyal13 Jun 26, 2018
d017353
Merge pull request #3 from pranjalrmcf7/patch-1
jatinkatyal13 Jun 26, 2018
0966155
Merge pull request #4 from nishchay1902/master
jatinkatyal13 Jun 26, 2018
5cb4e48
Merge pull request #5 from AyushRawat23/master
jatinkatyal13 Jun 26, 2018
4c4e790
Merge pull request #6 from akshatpathak/master
jatinkatyal13 Jun 26, 2018
6dbce1b
Merge pull request #7 from akshatpathak/patch-1
jatinkatyal13 Jun 26, 2018
0d2a570
Merge pull request #8 from kandharikarteek/kandharikarteek-patch-1
jatinkatyal13 Jun 26, 2018
300bace
Merge pull request #9 from Harmeet17/patch-1
jatinkatyal13 Jun 26, 2018
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
60 changes: 60 additions & 0 deletions Class
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
class Employee:
raise_amount = 1.02

def __init__(self,first,last,pay):
self.first = first
self.last = last
self.pay = pay
self.email = first + '.' + last +'@gmail.com'

def fullname(self):
print(self.first ,self.last)

def apply_raise(self):
self.pay = int(self.pay * self.raise_amount)


class Developer(Employee):
raise_amount = 1.10

def __init__(self,first,last,pay,prog_lang):
super().__init__(first,last,pay)
self.prog_lang = prog_lang


class Manager(Employee):
raise_amount = 1.05

def __init__(self,first,last,pay,employees):
super().__init__(first,last,pay)
self.employees = employees

def add_emp(self,emp):
if emp not in self.employees:
self.employees.append(emp)

def remove_emp(self,emp):
if emp in self.employees:
self.employees.remove(emp)

def print_emp(self):
for emp in self.employees:
print(emp.fullname())



dev_1 = Developer('Pranjal','RMCF',140000,'Python')
dev_2 = Developer('James','Dean',115000,'Java')
dev_3 = Developer('Michael','Jackson',90000,'Ruby')
dev_4 = Developer('Daniel',"Radcliffe",85000,'C')

mgr_1 = Manager('Steven','Spielberg',120000,[dev_1,dev_4])
mgr_2 = Manager('James','Cameron',110000,[dev_2,dev_3])

#print(dev_1.email)
mgr_1.print_emp()
#mgr_1.add_emp(dev_3)
#mgr_1.print_emp()
#print(dev_4.prog_lang)
#print(isinstance(dev_4,Manager))
#print(issubclass(Developer,Manager))
1 change: 1 addition & 0 deletions New code
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Hello-World')
7 changes: 7 additions & 0 deletions Phone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import re
n=input()
pattern = re.compile("[789]")
if pattern.match(n)!=None and len(n)==10:
print("Valid")
else:
print("Invalid")
7 changes: 7 additions & 0 deletions Qspace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
f=str(input("Name:"))
f=f+".txt"
f=open(f,'r')
y=str(f.read())
l=[]
l=y.split(' ')
print(len(l)-1)
Binary file added a.npy
Binary file not shown.
Binary file added ab.npz
Binary file not shown.
8 changes: 8 additions & 0 deletions biased coin simulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import random
x=random.choice(['heads','tails'])
print(x)
y=random.random()
if y<0.6:
print('heads')
else:
print('tailsb')
9 changes: 9 additions & 0 deletions codes/check_cons_ones.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
n=input('enter the binary number: ')
k=input('enter the value of K: ')
g=0
l=int(k)
g='1'*l
if(g in n):
print("yes there are given no. of consecutive 1's in the binary number")
else:
print('NO')
5 changes: 5 additions & 0 deletions diagonal elements
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import numpy as np
a=np.array([[1,2,3],[5,6,7],[9,10,11]])
print(a)
for i in range(3):
print(a[i,i],a[i,2-i])
24 changes: 24 additions & 0 deletions pallindrome
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
s = []
copy = ""
count = -1
n = int(input("enter number of strings: "))
for i in range(n):
s.append(input())
for i in s:
if i == i[::-1]:
print("-1")
else:
for j in range(0,len(i)):
copy=""
for k in range(0,len(i)):
if k == j:
continue
copy+=i[k]
# print(copy)
count+=1
if copy == copy[::-1]:
print(count)
break
else:
print("-1")
count = -1
9 changes: 9 additions & 0 deletions pattern.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
n = int(input("Enter an odd number for a beautiful pattern: "))
if n%2 != 0:
for i in range(n):
for j in range(n):
print(n-min(i,j,n-1-i,n-1-j),end="")
print()
else:
print("Not an odd number")