Posts

Showing posts from June, 2024

Django Tutorial by w3schools.com

Image
Django Tutorial by w3schools.com      Create Virtual Environment python -m venv myworld Windows: D:\  myworld\Scripts\activate.bat Unix/MacOS: $ source myworld/bin/activate $ django-admin --version (myworld) ... $  python -m pip install Django When I enter Command $ apt-get update it gives an error message  "Permission Denied:" Then i tried My First Project (main project then some apps into it like members ) django-admin startproject my_tennis_club   py manage.py runserver  output will be like To Create App (in main dir of my_tennis_club) python manage.py startapp members   my_tennis_club     manage.py     my_tennis_club/     members/         migrations/             __init__.py         __init__.py         ...

Python Django for Beginners with 2 Practical Projects https://www.udemy.com/course/python-django-for-beginners-with-2-practical-projects/learn/lecture/37682738#overview

Image
 Python Django for Beginners with 2 Practical Projects https://www.udemy.com/course/python-django-for-beginners-with-2-practical-projects/learn/lecture/37682738#overview  $ python -m pip install --upgrade pip $ pip install virtualenv $ source env/Scripts/activate  to activate a virtual environment with env $ pip freeze  No package is installed in virtual env:  To deactivate virtual env $ deactivate  No see again the list of all packages installed in our Gobal Env: $ pip freeze Now to install django $ pip install django $ python manage.py runserver

https://app.programiz.pro/community-challenges/challenge/

Image
SOME HARD CHALLENGES FOR ME  https://app.programiz.pro/community-challenges/challenge/flatten-nested-list-iterator/info  Problem Chalange SOLUTION Note: same function is used in the function recursivly  def flatten_nested_list ( nested_list ):     rl= []     for item in nested_list :         if type ( item ) == list :             rl.extend ( flatten_nested_list ( item ))         else :             rl.append ( item )     return rl Problem Challenge solution: def convert_to_title ( n ):     result= ''     no26 = 0     r = n -26     while r > 0 :         no26+= 1         r = r -26     alpha1= ''     if no26 > 0 :         alpha1= chr ( 64 +no26 )         alpha2= chr ( 64 +n- ( 26 *no26 ))   ...

Diploma in Python Programming by www.alison.com

Image
  Diploma in Python Programming      by www.alison.com DATE AND TIME FUNCTIONS INPUT: import datetime date=input('Enter DOB dd/mm/yyyy format') or '20/08/1966' ddate=datetime.datetime. strptime (date,'%d/%m/%Y').date() print(datetime.datetime. strftime (ddate,'Your born on %A %B, %Y')) diff=datetime.date.today()-ddate print('Your Age Is',diff)       print('day',ddate.day,'Month',ddate.month,'year',ddate.year) OUTPUT is as under ============================================================== ========= RESTART: C:/Users/S.A COMPUTER/AppData/Local/Programs/Python/Python311/temp ======== Enter DOB dd/mm/yyyy format Your born on Saturday August, 1966 Your Age Is 21118 days, 0:00:00 day 20 Month 8 year 1966 https://strftime.org/ ================================= Some Quiz Question practice: There are a lot of different versions of Python that you could use, select three versions from the following list:     I think IronPython, JP...