python - Can someone point out the errors in this code? -


i'm beginner python programmer trying execute code don't quite know def function yet... can point out errors in code , how fix them?

import math   def main():     radius = get_radius()     calculate = cal_volume()     dis = display()  def get_radius():     rad = float(input("enter radius :"))     return rad  def cal_volume(radius):     return 4/3*math.pi*radius**3  def display(cal_volume):     print("the volume :",cal_volume)  main()     

you didn't provide parameters cal_volume() , display() in def main().

it should be:

import math   def main():     radius = get_radius()     calculate = cal_volume(radius)     dis = display(calculate)     # print out result?  def get_radius():     rad = float(input("enter radius :"))     return rad  def cal_volume(radius):     return 4/3*math.pi*radius**3  def display(cal_volume):     print("the volume :",cal_volume)  main() 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -