Zend Anwar

Full stack web developer

Author: zendnwar

Syntax of Python Function

def functionname(parameters): “””docstring””” statement(s) return [expression] Example: #!/usr/bin/python # Function definition is here def ima( lovestr ): “This prints a passed string into this function” print lovestr return; # Now you can call ima function ima(“I’m fall in love!”)

Read More

Star triangle with python for loop

>>> star =  input(“Enter the star to draw: “) Enter the star to draw: * >>> limit = int(input(“Enter the limit: “)) Enter the limit: 10 >>> for i in range(1, limit+1): print (star*i) Output–    * ** *** **** ***** ****** ******* ******** ********* **********

Read More

Multiplication table in python

>>> var = 5 >>> for i in range(1,11): multiply = var * i print (“Multiplication table”, var,”*”, i,”=”,multiply)  Output– Multiplication table 5 * 1 = 5 Multiplication table 5 * 2 = 10 Multiplication table 5 * 3 = 15 Multiplication table 5 * 4 = 20 Multiplication table 5 * 5 = 25 […]

Read More

Python continue

>>> for var in “zend-anwar”: if var == “-“: continue print (var) output– z e n d a n w a r

Read More

Python break

>>> for var in “zend-anwar”: if var == “-“: break print (var) output—    z e n d

Read More

Enabling clean URLs Drupal

Open your .htaccess file in your project root. Uncomment RewriteBase /drupal and change it to your project name like RewriteBase /projectname . Comment RewriteBase / Goto /admin/config/search/clean-urls There will be an option to Enable clean URLs .

Read More

How to show hostname & IP address with python programming

The Internet Protocol assigns a 4-byte address to every computer connected to the network. Such addresses are usually written as four decimal numbers, separated by periods, which each represent a single byte of the address. Each number can therefore range from 0 to 255. So an IP address looks like this: 202.168.3.180 Because purely numeric […]

Read More

Magento admin panel gives 404 when trying to enter CMS pages

You are getting a 404 on CMS pages because of the remains of old store views still hanging around in the database after deleting store views from Magento admin, to clean up ( delete ) old unused CMS pages for store views you have deleted run this MySQL query. DELETE FROM cms_page_store WHERE store_id NOT […]

Read More

What is Shell Script ?

The shell is the utility that processes your requests. Shell Script is series of command written in plain text file. Shell script is just like batch file is MS-DOS but have more power than the MS-DOS batch file.

Read More

Magento2 admin menu panel doesn’t work

It’s very simple solution : line 574  in Magento2.2 remove  <item name=”view_preprocessed” xsi:type=”object”>Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item> refresh, hope it will work.    

Read More