Skip to content

Commit

Permalink
intial commit
Browse files Browse the repository at this point in the history
intial commit
  • Loading branch information
codeperfectplus committed Oct 17, 2019
0 parents commit 2778bf9
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
123 changes: 123 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Deepak Raj

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions While_loop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'''while Loop'''
'''github'''

condition=2

while condition<=10:
print(condition)
condition+=1

'''Infinty Loop'''

while True:
print('Doing stuff')
21 changes: 21 additions & 0 deletions condtionals and booleans.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

class Employee:
"""A sample Employee class"""

def __init__(self, first, last):
self.first = first
self.last = last

print('Created Employee: {} - {}'.format(self.fullname, self.email))

@property
def email(self):
return '{}.{}@email.com'.format(self.first, self.last)

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


emp_1 = Employee('peter', 'anderson')
emp_2= Employee('joy', 'andrew')
8 changes: 8 additions & 0 deletions for loop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'''For Loop'''

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]
for x in list_001:
print(x)
print('Next')

print('continue program')
22 changes: 22 additions & 0 deletions function2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
def my_func(food):
for x in food:
print(x)

fruits_list =['Apple','Mango','Banana','Guavava']
electronics_item=['charger','iron','Fridge','Fan',"T.v"]

print('List 1')
my_func(fruits_list)
print('----------------------')
print('List 2')
my_func(electronics_item)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

def mul_fun(x):
return 2**x

print(mul_fun(2))
print(mul_fun(3))
print(mul_fun(4))
print(mul_fun(5))
print(mul_fun(6))
Empty file added function3.py
Empty file.
33 changes: 33 additions & 0 deletions python_function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
def fname():
print("Hello")
fname()

#######################

def my_function(fname,lname):

print(fname,lname)


my_function('John','Green')
my_function('Alice','bob')
my_function('Eve','addy')


#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def my_function2(country='India'):
print("I am From "+ country)

my_function2("U.S.A")
my_function2("U.K")
my_function2()
my_function('United','Nation')

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


def func():
print('This is a my_function')

func()
func()
20 changes: 20 additions & 0 deletions python_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import json

x = {
"name": "John",
"age": 30,
"married": True,
"divorced": False,
"children": ("Ann","Billy"),
"pets": None,
"cars": [
{"model": "BMW 230", "mpg": 27.5},
{"model": "Ford Edge", "mpg": 24.1}
]
}

# convert into JSON:
y = json.dumps(x)

# the result is a JSON string:
print(y)
2 changes: 2 additions & 0 deletions range_function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
for x in range(1,10):
print(x)

0 comments on commit 2778bf9

Please sign in to comment.