Git Product home page Git Product logo

python_101's Introduction

Python 101

Setup

  1. Go to https://repl.it/
  2. Click “+ new repl” in top right corner
    • Select “bash”
    • “Create repl”

About Python

Python is a high-level general purpose programming language. That means it is relatively easy to read and write, and can be used for a multitude of different purposes.

The Basics

Data Types

Python has all of the basic data types that you might expect to find in a programming language. An incomplete list of the most frequently encountered data types is below:

  • Integer
  • Float
  • String
  • Boolean

Data Structures

Python has a variety of data structures which are important to understand before undertaking a more advanced project.

  • Tuple
  • List
  • Dictionary
  • Set

Core Functions/Commands

import - Used to import Python packages and module, which allow for funtionality beyong what is offered by standard Python. Imports are traditionally handled at the beginning of a Python file. Example: import os

print - Prints text to the console Example: print("Hello, world!")

Loops

For Loop

A for loop repeats an action for every item in a set. For example, a for loop may print the value of each object in a list, no matter the length of the list.

example_list = ['d', 'a', 's', '4', 2, 'done!']

for item in example_list:
	print(item)

Result:

d
a
s
4
2
done!

While Loop

A while loop continues to perform an action while a defined condition is true.

i = 0

while i < 5:
	print(i)
	i = i + 1

Result:

0
1
2
3
4

python_101's People

Contributors

jbonatakis avatar

Watchers

James Cloos 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.