Skip to content

Commit 2778bf9

Browse files
intial commit
intial commit
0 parents  commit 2778bf9

11 files changed

+265
-0
lines changed

Diff for: .gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

Diff for: .gitignore

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# pipenv
86+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
87+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
88+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
89+
# install all needed dependencies.
90+
#Pipfile.lock
91+
92+
# celery beat schedule file
93+
celerybeat-schedule
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
100+
.venv
101+
env/
102+
venv/
103+
ENV/
104+
env.bak/
105+
venv.bak/
106+
107+
# Spyder project settings
108+
.spyderproject
109+
.spyproject
110+
111+
# Rope project settings
112+
.ropeproject
113+
114+
# mkdocs documentation
115+
/site
116+
117+
# mypy
118+
.mypy_cache/
119+
.dmypy.json
120+
dmypy.json
121+
122+
# Pyre type checker
123+
.pyre/

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Deepak Raj
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: While_loop.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'''while Loop'''
2+
'''github'''
3+
4+
condition=2
5+
6+
while condition<=10:
7+
print(condition)
8+
condition+=1
9+
10+
'''Infinty Loop'''
11+
12+
while True:
13+
print('Doing stuff')

Diff for: condtionals and booleans.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
class Employee:
3+
"""A sample Employee class"""
4+
5+
def __init__(self, first, last):
6+
self.first = first
7+
self.last = last
8+
9+
print('Created Employee: {} - {}'.format(self.fullname, self.email))
10+
11+
@property
12+
def email(self):
13+
return '{}.{}@email.com'.format(self.first, self.last)
14+
15+
@property
16+
def fullname(self):
17+
return '{} {}'.format(self.first, self.last)
18+
19+
20+
emp_1 = Employee('peter', 'anderson')
21+
emp_2= Employee('joy', 'andrew')

Diff for: for loop.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'''For Loop'''
2+
3+
list_001=[21,22,54,67,78,44,36,89,95,34,23,66,42,62,67,42,56,24,34,63,23,52,25,27,38]
4+
for x in list_001:
5+
print(x)
6+
print('Next')
7+
8+
print('continue program')

Diff for: function2.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
def my_func(food):
2+
for x in food:
3+
print(x)
4+
5+
fruits_list =['Apple','Mango','Banana','Guavava']
6+
electronics_item=['charger','iron','Fridge','Fan',"T.v"]
7+
8+
print('List 1')
9+
my_func(fruits_list)
10+
print('----------------------')
11+
print('List 2')
12+
my_func(electronics_item)
13+
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14+
15+
def mul_fun(x):
16+
return 2**x
17+
18+
print(mul_fun(2))
19+
print(mul_fun(3))
20+
print(mul_fun(4))
21+
print(mul_fun(5))
22+
print(mul_fun(6))

Diff for: function3.py

Whitespace-only changes.

Diff for: python_function.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
def fname():
2+
print("Hello")
3+
fname()
4+
5+
#######################
6+
7+
def my_function(fname,lname):
8+
9+
print(fname,lname)
10+
11+
12+
my_function('John','Green')
13+
my_function('Alice','bob')
14+
my_function('Eve','addy')
15+
16+
17+
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18+
def my_function2(country='India'):
19+
print("I am From "+ country)
20+
21+
my_function2("U.S.A")
22+
my_function2("U.K")
23+
my_function2()
24+
my_function('United','Nation')
25+
26+
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27+
28+
29+
def func():
30+
print('This is a my_function')
31+
32+
func()
33+
func()

Diff for: python_json.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import json
2+
3+
x = {
4+
"name": "John",
5+
"age": 30,
6+
"married": True,
7+
"divorced": False,
8+
"children": ("Ann","Billy"),
9+
"pets": None,
10+
"cars": [
11+
{"model": "BMW 230", "mpg": 27.5},
12+
{"model": "Ford Edge", "mpg": 24.1}
13+
]
14+
}
15+
16+
# convert into JSON:
17+
y = json.dumps(x)
18+
19+
# the result is a JSON string:
20+
print(y)

Diff for: range_function.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
for x in range(1,10):
2+
print(x)

0 commit comments

Comments
 (0)