Introduction: Python Programming - Circumference of a Circle

Picture of Python Programming - Circumference of a Circle

Short Python program that calculates the circumference of a circle.

Code is below and attached.
==================================================
print ("This will calculate the circumference of a circle.")
pi = 3.141592
print ("Pi is:", pi)

DiameterEntered = input("Please enter the diameter: ")

# Converting diameter to a floating number
DiameterFloat = float(DiameterEntered)

# Calculating the circumference of a circle
circumference = pi*DiameterFloat
print ("The circumference is: ", circumference)

Comments

About This Instructable

1,131views

3favorites

License:

Bio: Occupation: Tech Support
More by matt392:Q-Tip Paint PenReplace Letters on Computer Keyboard (or Make Bigger Letters) With Nail PolishMulti-bit Screwdriver From PVC Pipe
Add instructable to: