Python

Python Slice Example

1. Slice List. Taking a partial element from a list or tuple is a very common operation. For example, how to take the first three elements from below list? >>> L = [‘Richard’, ‘Tom’, ‘Jerry’, ‘Jackie’, ‘Kevin’] You can take elements from above list like below. >>> [L[0], L[1], L[2]] [‘Richard’, ‘Tom’, ‘Jerry’] But when you

Python Slice Example Read More »

Python Django Model Example

Model is generally used to represent database table data. It contains the basic fields and behaviors of the data you are storing. Django provides structured data processing and operation processing for your network applications through the abstract model layer (models). Database-related code is generally written in models.py. Django supports SQLite3, MySQL, PostgreSQL and other databases,

Python Django Model Example Read More »