Skip to content

Commit

Permalink
intial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
codeperfectplus committed Dec 7, 2019
1 parent 71bd068 commit 374e6dd
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 2 deletions.
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\\Flash\\Anaconda3\\python.exe"
}
2 changes: 0 additions & 2 deletions Numpy/Binary Operatons_Numpy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#Binary Operatons_Numpy\

#np is alias to numpy
import numpy as np

a = np.array( [[1, 2],
Expand Down
File renamed without changes.
Empty file added Python Basic/Magic Method.py
Empty file.
7 changes: 7 additions & 0 deletions Python Basic/args and kwargs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def student(*args, **kwargs):
print(args)
print(kwargs)

courses = ['Math', 'Science', 'History']
info = {'name' :'Deepak', 'age' :22}
student(*courses,**info)
12 changes: 12 additions & 0 deletions Python Basic/function basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def welcome(greeting):
return "Hello and {}".format(greeting)

name = input("Enter Your Name Below : \n")
age = int(input("Enter Your Age Below :\n"))
print(welcome("Welcome"),'{}'.format(name))
if age < 18:
print("You Are Not Eligible For Voting")

else :
print("You Are Eligible For Voting!")

42 changes: 42 additions & 0 deletions Python Basic/python_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class Empl(object):

"""docstring for Empl"""
raise_amount = 1.04
def __init__(self, first, last, pay):
self.first = first
self.last = last
self.pay = pay

def fullname(self):
return '{} {}'.format(self.first, self.last)

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

@classmethod
def set_raise_amt(cls, amount):
cls.raise_amount = amount

def __repr__(self):
return '{} {}'.format(self.first,self.last)

def __str__(self):
return '{} {}'.format(self.first,self.last)

emp_1 = Empl('Deepak', 'Raj', 50)
emp_2 = Empl('Keshav', 'Raj', 3235345)

#print(emp_1.fullname())
#print(emp_2.fullname())

'''print(emp_1.pay)
emp_1.apply_raise()
print(emp_1.pay)
'''
#print(emp_1.__dict__)


print(repr(emp_1))
print(str(emp_1))


0 comments on commit 374e6dd

Please sign in to comment.