Site menu

CodeCook.io

  • Languages
    • C
    • C++
    • CSS
    • Git
    • HTML
    • Java
    • JavaScript
    • jQuery
    • PHP
    • Python
    • Ruby
    • Scala

Python - recipes

  • {{ item.name }}
  • Append item to array
  • Apply function to list
  • Array length
  • Block comment
  • Break out of loop
  • Check variable is defined
  • Class definition
  • Class function
  • Concatenate two arrays
  • Counter loop
  • Create a list of integers
  • Create key value container
  • Django check object exists
  • Django get domain current request
  • Django redirect directly in urls.py
  • Documentation comment
  • Do loop while a condition is true
  • Exception handling
  • Filter Queryset on any of Django Q objects list
  • Find index of item in array
  • For each loop
  • Function default parameter
  • Get all fields in Django model
  • Get first element array
  • Get last element of array
  • Hello world
  • Highest value of array of numbers
  • If condition do
  • If else
  • If, else if, else
  • Increment variable by one
  • Inline conditional
  • Key value item count
  • Key value key existence test
  • key value list all keys
  • key value list all values
  • Loop until condition is true
  • Lower case string
  • Map over array
  • Object inner function
  • Object instantiation
  • Open debug command line
  • Prepend item to list
  • Random integer in range
  • Range of alphabet chacters
  • Repeat string
  • Reverse string
  • Set maximum number of relations in ManyToManyField in Django form
  • Single comment
  • Singleton - one object instance for class
  • Sort list of numbers
  • Sort objects by function
  • String concatenation
  • String length
  • String to lowercase
  • String to uppercase
  • Switch
  • Test array contains item
  • Test for expression in string
Python logo

Python

documentation url
https://docs.python.org/3/
site url
https://www.python.org/
language type
object oriented

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. -python.org

  • Blog
  • About
  • License