Hollow Diamond


Drawing different shapes with the help of coding is quite  enjoyable and interesting. Mostly the first semester students of software engineering encounter with this.

so, let us learn, how to draw a hollow diamond using python?

First of all declare variables:


Diamond consists of two cones, upper cone with pointed top and lower cone with pointed bottom.
so let us write the code for the upper cone, but the cone must be hollow:


The resultant of this code is as under:


Now, write the code for lower hollow cone:


The output for this code is:


Now, run both the codes simultaneously, and the output is:


the reason for this output:


This is one of the possibilities of writing code, to get this output. There might be other ways of doing the same task. Keep finding and trying different ways of coding. And do remember: Programming language doesn't matter but logic matters. So, work mainly on logic building.




Comments

Popular posts from this blog

An Interview with Pakistani Data Scientist : Dr. Zeeshan Ul Hassan Usmani

Relational Data Model

Data Engineering Tools

Relational DB, ORM and ERP systems

Freshman Year : For All Engineering Students

Web Scraping : Urdu News

Applications of Data Engineering

A Survey of the Final Year University Students

Pintos : Series : Part3 : Project 1 : Alarm Clock

Web Applications