GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - stepanenko/python-info: My notes on the Python language

BranchesTags
Open more actions menu

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
server.py
server.py
 
 
types.md
types.md
 
 

Repository files navigation

Python

  • Open-source, interpreted and dynamic language
  • Created in 1991, by a developer named Guido Van Rossum.
  • Most popular Python web frameworks are: Django, Flask, Falcon, Pyramid, and Bottle

Minimalistic Python Docs: https://pythonbasics.org/


Download from: https://www.python.org/downloads/

Use python3 --version to see if python 3 is installed and print its version (on Windows it could be python --version)

To run a python file use python3 filename.py - don't forget the .py at the end (on Windows it could be python filename.py)

Examples

# For loop 1
for i in range(1, 6):
    print(i)

# For loop 2
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
    print(fruit)

# Nested For loops
for i in range(3):
    for j in range(2):
        print(f"({i}, {j})")

# While loop
count = 0
while count < 5:
    print(count)
    count += 1

# Example of a list comprehension
numbers = [1, 2, 3, 4, 5]
squared_numbers = [x ** 2 for x in numbers]
print(squared_numbers)
# iterates over an iterable and applies an expression to each element to generate a new list.

Data types

If you want to specify the data type, you can use the following constructor functions:

x = str("Hello World")
x = int(20)
x = float(20.5)
x = complex(1j)
x = list(("apple", "banana", "cherry"))
x = tuple(("apple", "banana", "cherry"))
x = range(6)
x = dict(name="John", age=36)
x = set(("apple", "banana", "cherry"))
x = frozenset(("apple", "banana", "cherry"))
x = bool(5)
x = bytes(5)
x = bytearray(5)
x = memoryview(bytes(5))

About

My notes on the Python language

Topics

python

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.