0

Im trying to create a chart for radii that the output looks like this.

Radius           Area            Circumference
1.000             3.142           6.283
2.000            ...               ...

The prints under main do not show up at all. Any suggestions on how I might fix this? Im using python 3.4.

def main():
    print('Radius\tArea\tCircumference')
    print('-----------------------------')


for Radius in range(1 , 11):
    round (3)

    Area = (Radius)**2*3.14
    Circumference =  (Radius)*2*(3.14)
    a = Radius
    b = Area
    c = Circumference
    d = round(a, 3)
    e = round(b, 3)
    f = round(c, 3)

    print ('{:2d}{:10.2f}{:10.2f}'.format(d, (e), (f)))
Tom
  • 5
  • 1
  • 3

2 Answers2

0

main() has no special meaning in Python. It's just a function like any other; if you want it to run, you need to explicitly call it.

NPE
  • 486,780
  • 108
  • 951
  • 1,012
0

You need to call the main() function. For example:-

def add(a,b):
    return a + b 

//Calling explicitly
answer = add(4,7)
print answer 

Output:-11

Community
  • 1
  • 1
Hussain Shabbir
  • 14,801
  • 5
  • 40
  • 56