diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dee113c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "C:\\Users\\Flash\\Anaconda3\\python.exe" +} \ No newline at end of file diff --git a/Numpy/Binary Operatons_Numpy.py b/Numpy/Binary Operatons_Numpy.py index be7651d..e2c541c 100644 --- a/Numpy/Binary Operatons_Numpy.py +++ b/Numpy/Binary Operatons_Numpy.py @@ -1,6 +1,4 @@ -#Binary Operatons_Numpy\ -#np is alias to numpy import numpy as np a = np.array( [[1, 2], diff --git a/Numpy/numpy.py b/Numpy/numpy 3.py similarity index 100% rename from Numpy/numpy.py rename to Numpy/numpy 3.py diff --git a/Python Basic/Magic Method.py b/Python Basic/Magic Method.py new file mode 100644 index 0000000..e69de29 diff --git a/Python Basic/args and kwargs.py b/Python Basic/args and kwargs.py new file mode 100644 index 0000000..1d6abed --- /dev/null +++ b/Python Basic/args and kwargs.py @@ -0,0 +1,7 @@ +def student(*args, **kwargs): + print(args) + print(kwargs) + +courses = ['Math', 'Science', 'History'] +info = {'name' :'Deepak', 'age' :22} +student(*courses,**info) \ No newline at end of file diff --git a/Python Basic/function basic.py b/Python Basic/function basic.py new file mode 100644 index 0000000..ec4f8f8 --- /dev/null +++ b/Python Basic/function basic.py @@ -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!") + diff --git a/Python Basic/python_class.py b/Python Basic/python_class.py new file mode 100644 index 0000000..d393c85 --- /dev/null +++ b/Python Basic/python_class.py @@ -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)) + + \ No newline at end of file