{"id":12027,"date":"2021-09-30T14:30:21","date_gmt":"2021-09-30T09:00:21","guid":{"rendered":"https:\/\/python-programs.com\/?p=12027"},"modified":"2021-11-22T18:34:33","modified_gmt":"2021-11-22T13:04:33","slug":"python-program-to-print-hollow-diamond-star-pattern","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-hollow-diamond-star-pattern\/","title":{"rendered":"Python Program to Print Hollow Diamond Star Pattern"},"content":{"rendered":"

Enhancing programming skills is very important no matter what language you have chosen. So, practice frequently with these simple java programs<\/a> examples and excel in coding the complex logic.<\/p>\n

Given the number of rows of the diamond pattern, the task is to print the Hollow diamond star pattern in C, C++, and Python<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given number of rows of diamond =6<\/pre>\n

Output:<\/strong><\/p>\n

      *\r\n    *   *\r\n   *     *\r\n  *       *\r\n *         *\r\n*           *\r\n *         *\r\n  *       *\r\n   *     *\r\n    *   *\r\n      *<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given number of rows of diamond =10\r\ngiven character to print ='^'<\/pre>\n

Output:<\/strong><\/p>\n

          ^\r\n        ^ ^\r\n       ^   ^\r\n      ^     ^\r\n     ^       ^\r\n    ^         ^\r\n   ^           ^\r\n  ^             ^\r\n ^               ^\r\n^                 ^\r\n ^               ^\r\n  ^             ^\r\n   ^           ^\r\n    ^         ^\r\n     ^       ^\r\n      ^     ^\r\n       ^   ^\r\n        ^ ^\r\n         ^<\/pre>\n

Program to Print Diamond Star Pattern in C, C++, and Python<\/h2>\n

Below are the ways to print Diamond Star Pattern in C, C++, and Python.<\/p>\n