Python Programming - Circumference of a Circle

Introduction: Python Programming - Circumference of a Circle

About: Occupation: Tech Support

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)

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Be the First to Share


    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020