Giter Site home page Giter Site logo

intro-python-i's Introduction

Intro to Python I

It's time to learn a new language! Python!

Python is a popular, easy-to-use programming language that has significant traction in the field.

Remember the goal is learning to learn, so keep track of what works for you and what doesn't as you go through the process of exploring Python.

Techniques for learning new languages

  • Try to relate things you already know in another language (e.g. what an array is) to the corresponding things in Python (e.g. a list) and how to use them.

  • Write a bunch of "toy programs" that demonstrate different key features of the language

  • Explore the standard library that's available for the language. Skim it briefly for now--the idea isn't to memorize everything but to file away generally what functionality is available.

  • Write a more substantial toy program that uses a variety of the features.

Again, keep track of what works for you. Try different things to see what works best for learning new languages.

Resources

Getting started

  1. Make sure you have Python 3 and pipenv installed.

  2. Go to the directory with the Pipfile and run

    pipenv install
    
  3. After the install completes, run

    pipenv shell
    

    This will get you into the virtual environment. At this point, you should be able to run Python 3 by just running python:

    $ python --version
    Python 3.6.5
    

    You can exit the virtual environment by typing exit.

Goals

  • Learn the basic syntax and structure of Python

Summary

  • Implement a number of tiny Python programs that demonstrate Python syntax and language concepts.

Instructions

Each directory inside the src/ directory presents exercises revolving around a particular concept in Python. Not all of these concepts are unique to Python (in fact, most probably aren't). This means that you can leverage knowledge you've obtained via exposure to other programming languages towards learning Python.

The suggested order for going through each of the directories is:

  • hello -- Hello world
  • bignum -- Print some big numbers
  • datatypes -- Experiment with type conversion
  • modules -- Learn to import from modules
  • printing -- Formatted print output
  • lists -- Python's version of arrays
  • tuples -- Immutable lists typically for heterogenous data
  • slices -- Accessing parts of lists
  • comprehensions -- List comprehensions
  • dictionaries -- Dictionaries
  • functions -- Functions
  • args -- Arguments and Keyword Arguments
  • scopes -- Global, Local, and Non-Local scope
  • file_io -- Read and write from files
  • cal -- Experiment with module imports and implement a text-based calendar
  • classes -- Classes and objects

Stretch Goals

  1. One of Python's main philosophical tenets is its emphasis on readability. To that end, the Python community has standardized around a style guide called PEP 8. Take a look at it and then go over the code you've written and make sure it adheres to what PEP 8 recommends. Alternatively, PEP 8 linters exist for most code editors (you can find instructions on installing a Python linter for VSCode here). Try installing one for your editor!

  2. Rewrite code challenges you've solved before or projects you've implemented before in a different language in Python. Start getting in as much practice with the language as possible!

  3. Write a program to determine if a number, given on the command line, is prime.

    1. How can you optimize this program?
    2. Implement The Sieve of Erathosthenes, one of the oldest algorithms known (ca. 200 BC).

intro-python-i's People

Contributors

beejjorgensen avatar br80 avatar et-code-home avatar johnoro avatar seanchen1991 avatar

Watchers

 avatar  avatar

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.