Photo by Nick Fewings on Unsplash

1. Anagram

from collections import Counter

s1 = 'below'
s2 = 'elbow'

print('anagram') if Counter(s1) == Counter(s2) else print('not an anagram')

2. Binary to decimal

decimal = int('1010', 2)
print(decimal) #10

3. Converting string to lower case

"Hi my name is Allwin".lower()
# 'hi my name is allwin'
"Hi my name is Allwin".casefold()
# 'hi my name is allwin'

4. Converting string to upper case

"hi…


Photo by Possessed Photography on Unsplash

1. Machine type


Photo by Roman Synkevych on Unsplash
  1. Add a .gitgnore file [The files and directories mentioned in this file will not be pushed to the remote]
touch .gitignore
git init
git add .
git commit -m "Initial commit"
git remote add origin youruser@yourserver.com:/path/to/my_project.git
git push origin master
git push origin HEAD:<your_branch_name>

  1. Pinterest
  2. LinkedIn
  3. Community web page of the flask

Disadvantages of flask

  1. Not suitable for big applications.
  2. Community.
  3. Full-Stack experience.
  4. No admin site.
  5. No login or authentication.
  6. ORM.
  7. Migrations can be difficult.


Photo by Hitesh Choudhary on Unsplash
  1. ascii_letters
  2. ascii_lowercase
  3. ascii_uppercase
  4. octdigits
  5. punctuation
  6. whitespace

1. ascii_letters


Photo by Behnam Norouzi on Unsplash
import calendar

Print a month’s calendar


Photo by Annie Spratt on Unsplash
import math
  1. ceil and floor
  2. factorial
  3. gcd
  4. sqrt
  5. pow
  6. sin, cos, tan
  7. exp
  8. fabs
  9. isclose
  10. constants

Ceil and floor functions


Photo by Chris Liverani on Unsplash
  1. mean()
  2. fmean()
  3. geometric_mean()
  4. median()
  5. median_low()
  6. median_high()
  7. mode()
  8. multimode()

1. mean()


Photo by Firmbee.com on Unsplash
  1. If the device is a mobile/PC
  2. Browser name
  3. Browser version
  4. OS of the computer or mobile
  5. OS version
  6. Device name
  1. The 'HTTP_USER_AGENT' header data from the request object
  2. Using a django-user-agents library.

1. The 'HTTP_USER_AGENT' data from the header


Photo by Laika Notebooks on Unsplash

How does it work?

code

Allwin Raju

Python Developer | Django Developer | Python enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store