Skip to main content

Featured post

How to Show Data science Project in Resume

In any project, the Data analyst role is to deal with data. The data for data science projects come from multiple sources. This post will explain how to put in data science project in Resume.
Data Science project for Resume The first step for an interview of any project is you need Resume. You need to tell clearly about your resume.

In interviews, you will be asked questions about your project. So the second step is you need to be in a position explain about project.

The third point is you need to explain the roles you performed in your data science project. If you mention the roles correctly, then, you will have 100% chance to shortlist your resume. Based on your experience your resume can be 1 page or 2 pages.
How to show Technologies used in Data science projects In interviews, again they will be asked how you used different tools to complete your data science project.

So, you need to be in a position to explain about how you used different options present in the tools. Sometime…

Calculate Circle Area the Logic You Need to write in Python

In Python, you can calculate circle area easily by using function. The purpose of Python is to use in data analysis.

Calculate circle area in Python using function. The logic you need given for your projects.

You need this logic in many areas. You can use in your present finance projects or new ones.

Benefits of function you can re-use the same code number of times
       
         Area of Circle=pi*r*r       
 

Area of Circle Steps Given - You Can do Using Two Methods, Explained Both Methods

I have given steps to calculate area of circle using two different methods. First I followed by creating an user defined function. Next directly I ran  the formula in interpreter.


Method-1

Steps I have followed to Calculate Area Using Function

  1. Logged into Cent Os (Linux)
  2. Create .py module
  3. Import .py module into Python
  4. Execute .py module

 1. Log in

I have first logged into CentOS. You can see there '$'.

login centos

2. Creating .py module

To create .py module. You can use vi editor command.

You need 'import decimal' to get Decimal values. Else you will get only integer.

py module

I have given pwd command. Which tells present working directory.

There you can give ls command.

You can see list of .py modules. Here, you can see two kinds of modules. Those are .py and .pyc.

The .py is our module, which contain function to calculate Circle area. The .pyc module is Python compiled module will store in the same directory. When you first import the module in Python, the .Pyc module will create by Python.

list of modules

3. Import Module from Operating system


You need to first go to Python using Python command. There, you can give import module-name.

During import .py for the module extension not required.

import module

 4. Execute Function with Circle area

You can pass a value to function to get area of circle.

result circle area

The value is rounded to 2 digits. I used round() function.

Bottom Line

Steps I used explained to calculate area using function.

In the similar way you can calculate areas for:

  1. Rectangle area
  2. Circle perimeter

Method-2

How to calculate Circle area using command line

You can give values directly in the Circle area formula to get area.

command line circle area

       
>>> import decimal
>>> from decimal import Decimal
>>>> Decimal(22)/Decimal(7)*10*10
 
 
 Related

Comments

Most Viewed

Hyperledger Fabric Real Interview Questions Read Today

I am practicing Hyperledger. This is one of the top listed blockchains. This architecture follows R3 Corda specifications. Sharing the interview questions with you that I have prepared for my interview.

Though Ethereum leads in the real-time applications. The latest Hyperledger version is now ready for production applications. It has now become stable for production applications.
The Hyperledger now backed by IBM. But, it is still an open source. These interview questions help you to read quickly. The below set of interview questions help you like a tutorial on Hyperledger fabric. Hyperledger Fabric Interview Questions1). What are Nodes?
In Hyperledger the communication entities are called Nodes.

2). What are the three different types of Nodes?
- Client Node
- Peer Node
- Order Node
The Client node initiates transactions. The peer node commits the transaction. The order node guarantees the delivery.

3). What is Channel?
A channel in Hyperledger is the subnet of the main blockchain. You c…