Code Monkey home page Code Monkey logo

pythonicway's Introduction

PythonicWay

Life is short, use Python!

Getting Started

What does pythonic mean? ~ Stack Overflow:

  • Exploiting the feature of the Python language to produce code that is clear, concise, and maintainable.
  • Code that doesn't just get the syntax right but that follows the conventions of the Python community and uses the language in the way it is intended to be used.

The repository contains two directories:

  • Normal way : Python programs written in a way that you'd usually see in other common languages such as Java/C++.

  • Pythonic way: The same programs as above, but redesigned to be more "pythonic".

The Zen of Python (PEP20), Tim Peters:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one — and preferably only one — obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!

Contributing

Please check the contribution guidelines for more information.

List of Completed Programs

Serial No. Program Normal Way Pythonic Way
1 Array Iteration arrayIteration.py arrayIteration.py
2 Reverse Array arrayReverse.py arrayReverse.py
3 Array Element Check checkElementExist.py checkElementExist.py
4 Check Empty Array checkEmpty.py checkEmpty.py
5 Construct Empty Array constructNewArrayWithoutAnElement.py constructNewArrayWithoutAnElement.py
6 Count Elements countElement.py countElement.py
7 Count Of Elements countOfElements.py countOfElements.py
8 Square Elements(Array) findSquareOfEveryElementInArray.py findSquareOfEveryElementInArray.py
9 Map Two Lists mapTwoLists.py mapTwoLists.py
10 Open File openFile.py openFile.py
11 Remove Duplicate removeDuplicate.py removeDuplicate.py
12 Replace Element(Array) replaceArrayElement.py replaceArrayElement.py
13 Reverse String reverseString.py reverseString.py
14 Shorthand Condition shorthandCondition.py shorthandCondition.py
15 Swapping Variables swappingVars.py swappingVars.py
16 Frequency of Words wordFrequency.py wordFrequency.py
17 Print String N Times printStringNTimes.py printStringNTimes.py
18 Transpose Of a Matrix transposeMatrix.py transposeMatrix.py
19 Calculate Cartesian Product cartesianProduct.py cartesianProduct.py
20 Switch Key and Value of Map dictKeyValueSwitch.py dictKeyValueSwitch.py
21 Key of Max Dictionary Value keyOfMaxDictVal.py keyOfMaxDictVal.py
22 Unpacking Arguments unpackVariables.py unpackVariables.py
23 Nested List into one List nestedListIntoOneList.py nestedListIntoOneList.py
24 Double the Even items in a List doubleEvenItems.py doubleEvenItems.py
25 Capitalize every word in a sentance capitalizeWordsInSentance.py capitalizeWordsInSentance.py
26 Check if a word is an anagram checkAnagram.py checkAnagram.py
27 Count the number of characters in a string countOfSpecificCharaters.py countOfSpecificCharaters.py
28 Unpacking different iterables using * unpackIterables.py unpackIterables.py

Contributions are welcome

pythonicway's People

Contributors

amoghrajesh avatar anoop447 avatar anqkhieu avatar ayushpandey8439 avatar el2e10 avatar hackerbone avatar kavienanj avatar kulkarnisuraj avatar lunchb0ne avatar preetesh21 avatar ralph44 avatar sudhamjayanthi avatar theanujdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pythonicway's Issues

Add a new section of Completed Programs in the Readme

It would be nice to see a table of completed programs and who completed them.
Easier for new contributors to see what all programs have been completed.

If you find this feature good , then do assign this issue to me @eldhoittangeorge

Add or improve the result in programs

All the programs in the repository have its result commented in the end. Some of the results require improvements and for some programs, the results are missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.