Foobar is a Python library for dealing with word pluralization.
Use the package manager pip to install foobar.
pip install foobar| # لیست کتابها | |
| 1. Automate the Boring Stuff with Python | |
| 2. Serious Python | |
| 3. expert python programming | |
| 4. Python Crash Course | |
| 5. headfirst python | |
| 6. python document | |
| ('the', 86496) |
| from django.contrib import admin | |
| from django.urls import include, path | |
| urlpatterns = [ | |
| path('polls/', include('polls.urls')), | |
| path('admin/', admin.site.urls), | |
| ] |
| from django.urls import path | |
| from . import views | |
| urlpatterns = [ | |
| path('', views.index, name='index'), | |
| ] |
| from django.http import HttpResponse | |
| def index(request): | |
| return HttpResponse("Hello, world. You're at the polls index.") |
Foobar is a Python library for dealing with word pluralization.
Use the package manager pip to install foobar.
pip install foobar| # Foobar | |
| Foobar is a Python library for dealing with word pluralization. | |
| ## Installation | |
| Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar. | |
| ```bash | |
| pip install foobar |
| #good | |
| if not seq: | |
| if seq: | |
| if process_ok: | |
| #bad | |
| if len(seq): | |
| if not len(seq): |
| #good | |
| if foo.startswith('bar'): | |
| if foo.endswith('bar'): | |
| #bad | |
| if foo[:3] == 'bar': | |
| if foo[7:10] == 'bar': |
| >>> nums = [10, 20, 30] | |
| >>> a, b, c = nums | |
| >>> a | |
| 10 | |
| >>> c | |
| 30 | |
| >>> student_tuple = ('Ayoub', [98, 85, 87]) | |
| >>> first_name, grades = student_tuple | |
| >>> first_name | |
| 'Ayoub' |
| >>> numbers = {num:num ** 2 for num in range(5)} | |
| >>> numbers | |
| {0: 0, 1: 1, 2: 4, 3: 9, 4: 16} | |
| >>> numbers = {x:x ** 2 for x in [1, 2, 3, 4, 5, 6] if x % 2 == 0} | |
| >>> numbers | |
| {2: 4, 4: 16, 6: 36} | |
| >>> names = ['ayoub', 'reza', 'mersad'] | |
| >>> names = {f:f.capitalize() for f in names} | |
| {'ayoub': 'Ayoub', 'reza': 'Reza', 'mersad': 'Mersad'} |