Skip to content

Commit 374e6dd

Browse files
intial commit
1 parent 71bd068 commit 374e6dd

File tree

7 files changed

+64
-2
lines changed

7 files changed

+64
-2
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "C:\\Users\\Flash\\Anaconda3\\python.exe"
3+
}

Numpy/Binary Operatons_Numpy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#Binary Operatons_Numpy\
21

3-
#np is alias to numpy
42
import numpy as np
53

64
a = np.array( [[1, 2],
File renamed without changes.

Python Basic/Magic Method.py

Whitespace-only changes.

Python Basic/args and kwargs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def student(*args, **kwargs):
2+
print(args)
3+
print(kwargs)
4+
5+
courses = ['Math', 'Science', 'History']
6+
info = {'name' :'Deepak', 'age' :22}
7+
student(*courses,**info)

Python Basic/function basic.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def welcome(greeting):
2+
return "Hello and {}".format(greeting)
3+
4+
name = input("Enter Your Name Below : \n")
5+
age = int(input("Enter Your Age Below :\n"))
6+
print(welcome("Welcome"),'{}'.format(name))
7+
if age < 18:
8+
print("You Are Not Eligible For Voting")
9+
10+
else :
11+
print("You Are Eligible For Voting!")
12+

Python Basic/python_class.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
class Empl(object):
2+
3+
"""docstring for Empl"""
4+
raise_amount = 1.04
5+
def __init__(self, first, last, pay):
6+
self.first = first
7+
self.last = last
8+
self.pay = pay
9+
10+
def fullname(self):
11+
return '{} {}'.format(self.first, self.last)
12+
13+
def apply_raise(self):
14+
self.pay = int(self.pay * self.raise_amount)
15+
16+
@classmethod
17+
def set_raise_amt(cls, amount):
18+
cls.raise_amount = amount
19+
20+
def __repr__(self):
21+
return '{} {}'.format(self.first,self.last)
22+
23+
def __str__(self):
24+
return '{} {}'.format(self.first,self.last)
25+
26+
emp_1 = Empl('Deepak', 'Raj', 50)
27+
emp_2 = Empl('Keshav', 'Raj', 3235345)
28+
29+
#print(emp_1.fullname())
30+
#print(emp_2.fullname())
31+
32+
'''print(emp_1.pay)
33+
emp_1.apply_raise()
34+
print(emp_1.pay)
35+
'''
36+
#print(emp_1.__dict__)
37+
38+
39+
print(repr(emp_1))
40+
print(str(emp_1))
41+
42+

0 commit comments

Comments
 (0)